{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.7.1"
    },
    "colab": {
      "name": "digitalTwin_Li_ION_.ipynb",
      "provenance": [],
      "collapsed_sections": []
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "AEil20eqS2So"
      },
      "source": [
        "# Hybrid digital twin of a Li-ion battery\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ZYaB7HSTS2Ss"
      },
      "source": [
        "import pandas as pd\n",
        "import numpy as np\n",
        "from sklearn.model_selection import train_test_split\n",
        "import keras\n",
        "import tensorflow as tf\n",
        "from keras.models import Sequential\n",
        "from keras.layers import LSTM, Dense\n",
        "from keras.optimizers import SGD\n",
        "from tensorflow.keras.layers import Dropout\n",
        "from matplotlib import pyplot as plt\n",
        "import plotly.express as px\n",
        "from plotly.subplots import make_subplots\n",
        "import plotly.graph_objects as go\n",
        "import plotly.figure_factory as ff"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "NIhtsIQHS2St"
      },
      "source": [
        "### 1. Load experimental data"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "UrmwSwuMS_iY"
      },
      "source": [
        "df = pd.read_csv('discharge.csv')"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "rWmpbfS7W9zV"
      },
      "source": [
        "df = df[df['Battery'] == 'B0005']\n",
        "df = df[df['Temperature_measured'] > 36] #choose battery B0005\n",
        "#df['Time'] =pd.to_datetime(df['Time'], unit='s')\n",
        "dfb = df.groupby(['id_cycle']).max()\n",
        "dfb['Cumulated_T'] = dfb['Time'].cumsum()"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "CcBEYPoQC9SE",
        "outputId": "7e16313e-8ccf-4422-a787-a8dba8e29a22"
      },
      "source": [
        "import plotly.express as px\n",
        "fig = px.scatter_matrix(dfb.drop(columns=['Time','type', 'ambient_temperature', \n",
        "                                          'time', 'Battery']), \n",
        "                                )\n",
        "fig.update_traces(marker=dict(size=2,\n",
        "                              color='crimson',\n",
        "                              symbol='square')),\n",
        "fig.update_traces(diagonal_visible=False)\n",
        "fig.update_layout(\n",
        "    title='Battery dataset',\n",
        "    width=900,\n",
        "    height=1200,\n",
        ")\n",
        "fig.update_layout({'plot_bgcolor': '#f2f8fd',\n",
        "                   'paper_bgcolor': 'white',}, \n",
        "                    template='plotly_white',\n",
        "                    font=dict(size=7)\n",
        "                    )\n",
        "\n",
        "fig.show()"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<html>\n",
              "<head><meta charset=\"utf-8\" /></head>\n",
              "<body>\n",
              "    <div>\n",
              "            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>\n",
              "                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
              "        <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>    \n",
              "            <div id=\"4bd7bdfc-750e-42ec-920f-038f8194f3c3\" class=\"plotly-graph-div\" style=\"height:1200px; width:900px;\"></div>\n",
              "            <script type=\"text/javascript\">\n",
              "                \n",
              "                    window.PLOTLYENV=window.PLOTLYENV || {};\n",
              "                    \n",
              "                if (document.getElementById(\"4bd7bdfc-750e-42ec-920f-038f8194f3c3\")) {\n",
              "                    Plotly.newPlot(\n",
              "                        '4bd7bdfc-750e-42ec-920f-038f8194f3c3',\n",
              "                        [{\"diagonal\": {\"visible\": false}, \"dimensions\": [{\"axis\": {\"matches\": true}, \"label\": \"Voltage_measured\", \"values\": [3.382030920346834, 3.402555164213981, 3.3983917051178256, 3.387662295366036, 3.3816165079954885, 3.3894008695365776, 3.3905909546310933, 3.3902023214986134, 3.389222836560145, 3.381883092252429, 3.3724865550263607, 3.3929640334056197, 3.391136671136594, 3.3761371666552367, 3.36555262878826, 3.3632045068591916, 3.3607878571588574, 3.3668882486387, 3.3655761278382963, 3.3921273951673667, 3.4216829893607774, 3.3997849445169006, 3.375984147607938, 3.3550028957442586, 3.3502372811751213, 3.34734864832686, 3.3270569907535843, 3.3230557814265733, 3.3330817840883213, 3.3389029195168196, 3.384907504366036, 3.382529693652939, 3.3584755700280287, 3.300948866119811, 3.3029466348369767, 3.3647015368462725, 3.3288344036974054, 3.2951290757680027, 3.287091851590302, 3.3362807176625853, 3.3781551347310823, 3.38914398589758, 3.3587800072475216, 3.3227263040476043, 3.2904209912445483, 3.2829294720753883, 3.302171141192652, 3.482756159727552, 3.4512391138278864, 3.412144542663899, 3.390147686486534, 3.3654542488086387, 3.3732982920197334, 3.4002007066759536, 3.366853685952623, 3.3658472834394972, 3.3510377920508687, 3.372300678940221, 3.393279574446315, 3.374829954822528, 3.3676893842909066, 3.3595334326399797, 3.3762292240247613, 3.3585136892834337, 3.3845559414062, 3.374338960367824, 3.364788132624517, 3.3651051100479434, 3.3671873144898665, 3.367841819385365, 3.3679376482538848, 3.363047481754589, 3.3658569522297443, 3.363333423651968, 3.3576419369198787, 3.3543597152642377, 3.33895634306046, 3.376612481247819, 3.3408525255733537, 3.316619096865081, 3.331978937607955, 3.3637701837611806, 3.3742266619984576, 3.366014003126303, 3.347227918761096, 3.3308622744462784, 3.3524328507467986, 3.370968772953889, 3.3723412081742787, 3.373949206231812, 3.401805596759808, 3.3964009104442194, 3.3841889049937146, 3.372137789732361, 3.3663271432523434, 3.3691656908256853, 3.3678982393260215, 3.368353588506166, 3.3665690125031458, 3.370170520357956, 3.3685874449322126, 3.3672150217291623, 3.3707159715731607, 3.4027816992161646, 3.3927111775420373, 3.3850435791279403, 3.3707861249033777, 3.372134483764732, 3.3846366518125435, 3.3901021748076587, 3.376126082807549, 3.367430296277881, 3.380112234998609, 3.3896312057933087, 3.3841125290664187, 3.3727083638369466, 3.363187546096453, 3.374842635852813, 3.392003337106902, 3.3902203920944376, 3.4007369290581804, 3.380373452666273, 3.3633183863069585, 3.3603431164447333, 3.35861610822223, 3.3546404197129442, 3.350619071847493, 3.343405953248601, 3.3402470170526657, 3.3408109567989284, 3.341645874691195, 3.337934423416156, 3.3695777194644068, 3.3800525919351263, 3.3674560555673088, 3.354469848098597, 3.3440569433884653, 3.359482865839045, 3.3654552474855444, 3.3533462284688103, 3.3397268692649167, 3.3301069205445533, 3.3472460227528518, 3.3480223789960224, 3.3341993629465567, 3.3204311172507404, 3.317292878825655, 3.3386967782212027, 3.334200417872135, 3.3159911839179785, 3.3492672986285803, 3.3459391127004348, 3.335683487283764, 3.3304160991620013, 3.325135247006119, 3.32437994007662, 3.322041733393672, 3.318281052145708, 3.3181042631206696, 3.3195360545043044, 3.32083463090636, 3.3240051679112965, 3.3186805073188768, 3.3167498357407514, 3.320443450038089, 3.321734617312716, 3.3461757937194423, 3.3517582683834912]}, {\"axis\": {\"matches\": true}, \"label\": \"Current_measured\", \"values\": [-2.0100685422582028, -2.0092360600464207, -2.008818044715942, -2.0098411145998294, -2.0093361626444737, -2.0114829793954594, -2.010120354685371, -2.008946953849664, -2.0103980563223964, -2.0082208981675684, -2.0090016165730957, -2.0104664632397866, -2.0091243441749773, -2.009134645115486, -2.0092165388352416, -2.008695812985012, -2.0101239353084868, -2.0090541939764326, -2.0086859191678115, -2.010485072856275, -2.0095722385869563, -2.0094060584925613, -2.00930869657557, -2.010621856370417, -2.009799404465436, -2.009884919735049, -2.0096094042624024, -2.0106484718303443, -2.009833490658412, -2.0091933341233505, -2.0092962316275367, -2.009397884789287, -2.006530429799968, -2.010508691418792, -2.0101349566233644, -2.0087172868321024, -2.0106782112031962, -2.0104928830300106, -2.0105183114732568, -2.009137866864989, -2.007062107022413, -2.0097184736554885, -2.010674319966458, -2.0065448124640706, -2.0104571886952525, -2.011017272187784, -2.010290170549633, -2.0085841618684808, -2.0093635509641032, -2.0093082757150555, -2.0098317678806343, -2.0088025696853493, -2.0070868474850903, -2.009226163987682, -2.0085055265966365, -2.0085954623833517, -2.00882303143347, -2.0100299199282947, -2.0088513371175005, -2.008884972941, -2.0000503266883563, -2.009167070749525, -2.0098367678965388, -2.009374324809828, -2.0092243605142746, -2.0090643522482696, -2.0095756763329056, -2.00939802202143, -2.0076614037586094, -2.007526984489124, -2.0096682471385865, -2.009950182299304, -2.0098007313967887, -2.0085236217867957, -2.008630382007576, -2.0093317692791595, -2.00816465102296, -2.008948665386312, -2.0097733166647846, -2.0092892869006262, -2.00591959552319, -2.0103709275456394, -2.010866235834328, -2.009883868462787, -2.0099116972564124, -2.009524244613264, -2.0087079415149285, -2.0085211642888776, -2.0092598546460816, -2.0089063022992053, -2.0092535367967748, -2.0090528032324446, -2.0084639673229563, -2.00909396796747, -2.0081781298438117, -2.0042382074596827, -2.0078782091189518, -2.0090775317162683, -2.0090186263179044, -2.007520938998223, -2.007391808552779, -2.0102732342081566, -2.0094629271805413, -2.00782790537943, -2.0094779666412808, -2.0085543538508985, -2.0096183778480827, -2.0102021660628, -2.0104728469195385, -2.008841772662637, -2.0031783321876, -2.00701250402231, -2.009470892650317, -2.0102156040109307, -2.0085274489055265, -2.0080157876113103, -2.0099550582252044, -2.011038471780101, -2.008112255638062, -2.0090938287323623, -2.0093162277877235, -2.008561563457563, -2.009095654918033, -2.0090944079243886, -2.0097160725449474, -2.0102041737931984, -2.009858777968568, -2.0096518160481627, -2.0080053876122252, -2.0101030152006008, -2.00860872039808, -2.0079722395100617, -2.0100254353832545, -2.009714103986401, -2.009580296684169, -2.009404648073863, -2.008191271346266, -2.0099376709383616, -2.0103458131977687, -2.0086017864244337, -2.0082855696701114, -2.008990163116172, -2.007983968912677, -2.0089416376655955, -2.008547372366202, -2.00853675328799, -2.0096125605983945, -2.0088079436992747, -2.008126652233745, -2.0037939750881995, -2.0083706909579377, -2.010193830467349, -2.0094173186613737, -2.008057045303391, -2.009480747629622, -2.008327475066528, -2.0089849550764067, -2.0089814512203046, -2.008733924006669, -2.0100079956290693, -2.0090384213781625, -2.0083286755886647, -2.0090273705659896, -2.0101919180377736, -2.0072463931643156, -2.0088416644953435, -2.0094646245710552, -2.0090095933031207]}, {\"axis\": {\"matches\": true}, \"label\": \"Temperature_measured\", \"values\": [38.90411223853604, 38.934589896270396, 38.74364933715347, 38.67251117886956, 38.5588283762414, 38.64849426602047, 38.707161399468006, 38.48247850754903, 38.46047117066617, 38.440002263808495, 38.42303985411221, 38.4674347458956, 38.50748485560728, 38.43649902755072, 38.16868880096885, 38.135992480077704, 38.235046911721184, 38.37206827600844, 38.41874277055602, 38.40348293513608, 38.90427046351709, 38.45267402611068, 38.14255653759616, 38.1130812025911, 38.184591581774185, 37.949467459972894, 38.01919311449829, 38.07657425769093, 37.93152652621658, 38.09349795180285, 38.431475133067295, 38.41151361110139, 38.23656074919321, 37.86193464017681, 37.85234522947546, 38.2195280246262, 37.97707473630467, 38.01040809761953, 37.78153326259964, 38.14716767155235, 38.66523767048857, 38.73374102208452, 38.46446447427885, 38.20618881420677, 37.871573694580434, 37.820049455433924, 38.042380967873534, 40.61676409324107, 39.75352205267765, 39.07955502788136, 38.7514197535489, 38.5521344719629, 38.74877822268547, 39.086996056790376, 38.78645819231579, 38.81108844804652, 38.66347864926757, 38.95945000158567, 39.134475655855475, 39.05947645454438, 38.988659823386286, 38.82686153852645, 39.275975313518494, 38.97342335718236, 39.331053622444905, 39.37256927347493, 39.20264067251961, 39.29223196862651, 39.393597884884564, 39.4709181709351, 39.54921072457339, 39.39370035955599, 39.522122794825336, 39.583822021338776, 39.42692706970709, 39.484665188466174, 39.32662729388425, 39.7034941383589, 39.265407543316286, 39.114406801572436, 39.32476838126078, 39.87862011320845, 40.00950856663861, 39.98828499189766, 39.700095117043546, 39.50409706767029, 39.91920745058851, 40.11005609160343, 40.17586235700117, 39.981420915320115, 40.37752962876011, 40.427414645604465, 40.14829951065202, 40.1449227052691, 40.040831608424796, 40.178578362590216, 40.220286761756896, 40.27625422581843, 40.18817948927436, 40.254840929285905, 40.30569908206496, 40.317307847716044, 40.436704898222594, 40.861529950994075, 40.85667657115688, 40.70819247073464, 40.54781449399642, 40.56795872332495, 40.91212796995131, 41.05450476478047, 40.72038694409774, 40.64572662339671, 40.97215861651164, 41.13410609927847, 41.03272022021008, 40.90528395430261, 40.80053581253233, 41.09540194136111, 41.31240545555636, 41.03039042540785, 41.218903653009626, 40.89182036981729, 40.65247840321352, 40.674403850596036, 40.71463450273824, 40.70565144370409, 40.696869156069326, 40.60442540222535, 40.55455497537322, 40.64562757946504, 40.72913511316858, 40.66733103851702, 41.016782657513716, 41.11358772081228, 41.0291651832534, 41.029714425555724, 40.725361461895965, 41.107728045756154, 41.31060428109281, 41.11334870752542, 40.89456069448349, 40.84992228375306, 41.14847344508205, 41.07861653298174, 40.92005469895581, 40.71555204594883, 40.6659906141436, 41.020065020059995, 41.00121346642115, 40.523979123550006, 40.899281677455136, 40.905184345691104, 40.753742955528345, 40.72306254078336, 40.712762891827715, 40.70252493379049, 40.769867912095535, 40.70780065437411, 40.68777813156935, 40.81433467794727, 40.934649901431314, 40.90160573764766, 40.92333096225439, 40.86467363859314, 40.85754514759514, 40.93702517259015, 40.93609151716196, 40.87390886969321]}, {\"axis\": {\"matches\": true}, \"label\": \"Current_charge\", \"values\": [1.9984, 1.9984, 1.9984, 1.9982, 1.9984, 1.9984, 1.9984, 1.9984, 1.9984, 1.9982, 1.9984, 1.9982, 1.9984, 1.9982, 1.9982, 1.9984, 1.9984, 1.9982, 1.9982, 1.9984, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9984, 1.9984, 1.9984, 1.9982, 1.9982, 1.9984, 1.9982, 1.9982, 1.9982, 1.9984, 1.9984, 1.9984, 1.9984, 1.9982, 1.9982, 1.9982, 1.9982, 1.9984, 1.9984, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9984, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9984, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9984, 1.9982, 1.9982, 1.9982, 1.9982, 1.9984, 1.9984, 1.9984, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982, 1.9982]}, {\"axis\": {\"matches\": true}, \"label\": \"Voltage_charge\", \"values\": [2.4659999999999997, 2.475, 2.4659999999999997, 2.454, 2.449, 2.458, 2.455, 2.454, 2.454, 2.449, 2.438, 2.457, 2.46, 2.447, 2.436, 2.431, 2.428, 2.436, 2.437, 2.4530000000000003, 2.4819999999999998, 2.4659999999999997, 2.444, 2.426, 2.421, 2.417, 2.4, 2.396, 2.4, 2.405, 2.44, 2.435, 2.41, 2.353, 2.354, 2.408, 2.375, 2.342, 2.333, 2.381, 2.4219999999999997, 2.435, 2.43, 2.376, 2.345, 2.338, 2.3569999999999998, 2.524, 2.484, 2.449, 2.428, 2.405, 2.406, 2.43, 2.4, 2.396, 2.3819999999999997, 2.41, 2.428, 2.414, 2.403, 2.3930000000000002, 2.418, 2.392, 2.423, 2.405, 2.394, 2.395, 2.398, 2.396, 2.399, 2.391, 2.394, 2.3930000000000002, 2.387, 2.385, 2.378, 2.418, 2.372, 2.344, 2.362, 2.396, 2.404, 2.396, 2.379, 2.364, 2.388, 2.404, 2.405, 2.408, 2.436, 2.424, 2.4130000000000003, 2.4, 2.394, 2.4019999999999997, 2.397, 2.405, 2.4019999999999997, 2.404, 2.403, 2.4, 2.41, 2.4459999999999997, 2.426, 2.416, 2.4019999999999997, 2.4019999999999997, 2.42, 2.423, 2.407, 2.399, 2.414, 2.424, 2.417, 2.4, 2.392, 2.398, 2.427, 2.438, 2.444, 2.42, 2.398, 2.395, 2.394, 2.391, 2.386, 2.381, 2.377, 2.377, 2.379, 2.378, 2.414, 2.423, 2.406, 2.392, 2.38, 2.398, 2.406, 2.394, 2.38, 2.366, 2.383, 2.384, 2.375, 2.36, 2.354, 2.375, 2.372, 2.3569999999999998, 2.385, 2.376, 2.365, 2.359, 2.35, 2.352, 2.3480000000000003, 2.345, 2.343, 2.344, 2.346, 2.35, 2.344, 2.342, 2.344, 2.347, 2.381, 2.383]}, {\"axis\": {\"matches\": true}, \"label\": \"Capacity\", \"values\": [1.8564874208181568, 1.8463272497199268, 1.835349194223408, 1.8352625275821128, 1.8346455082120416, 1.8356616600675493, 1.8351461429226603, 1.8257567905665533, 1.8247738529891333, 1.824613268496936, 1.8246195526864504, 1.814201935767392, 1.8137521577549047, 1.8134404914735824, 1.8025980036306504, 1.8021069002461496, 1.8025795008262089, 1.8030683142834096, 1.802777624719604, 1.8470259949329195, 1.847417311283644, 1.8361774213478947, 1.825780747577624, 1.8251136435078368, 1.825581504220376, 1.814031127508391, 1.8147691941158937, 1.8139693887103518, 1.8027656651678232, 1.8040770401173518, 1.8518025516704488, 1.8307038456739428, 1.8199041089501269, 1.809307963702852, 1.8046099045805202, 1.7993770651972192, 1.7884432335370462, 1.7829230484252725, 1.7730337158018288, 1.773037755078937, 1.7678721106662054, 1.762315070409309, 1.7676172924938447, 1.762668359743147, 1.7517304870664143, 1.7418496047960008, 1.7360913511847138, 1.7936240148573608, 1.7831890223273277, 1.7673642076278957, 1.7570177850353066, 1.7468706179837907, 1.7417172507457144, 1.7364225056478186, 1.7263217239235826, 1.7158065389330133, 1.710533351135192, 1.706014499648521, 1.7003110272642588, 1.6945798601797897, 1.6849029086609286, 1.6744741591159715, 1.6745692479879102, 1.663716375981405, 1.6590138687482459, 1.6538540573335014, 1.6426537821301308, 1.6378578430223698, 1.6327350407099108, 1.6277528915533617, 1.622125485521159, 1.6113256603765849, 1.6065631397488385, 1.6015142233917594, 1.590369231400328, 1.5857889968242211, 1.5849430707374117, 1.5955263892495937, 1.5747301747801037, 1.5649019950937946, 1.5597659473370362, 1.5594815668184234, 1.5546893535906101, 1.5488741079890418, 1.5382365989425582, 1.5279142582510281, 1.5285252629756445, 1.5226473252843782, 1.5174859938489869, 1.605818899130659, 1.5638491446744425, 1.5480915247767786, 1.5323755631868592, 1.5269528268489705, 1.5169573017136326, 1.511897596014269, 1.5065638960681105, 1.5015453526671363, 1.4908444050400238, 1.485868384561201, 1.480413677976106, 1.4752095869031632, 1.4859035988304024, 1.4960918298136696, 1.4808005946928984, 1.4697543268466824, 1.4539012274845928, 1.454146206723569, 1.455023751906683, 1.4490421637612358, 1.4386709371480566, 1.4334454321569792, 1.4333958900838095, 1.4280648734477601, 1.4229203181741186, 1.417429032731308, 1.412409228794446, 1.4125787929401932, 1.4075983731469897, 1.4333920485221476, 1.4382550176792908, 1.4173547174485526, 1.4069816636776429, 1.4012037783587623, 1.3967008232726328, 1.391284788852726, 1.3862287677978349, 1.3804366761974138, 1.3752364150256224, 1.3705128024895008, 1.37050855662704, 1.3647355108681518, 1.375392016895762, 1.3861115151535393, 1.369850003583894, 1.3647827949260758, 1.3543220466259964, 1.3546417018378962, 1.354703921319241, 1.349314997503458, 1.3441891937970554, 1.3389913790695755, 1.3389145230206971, 1.3340066759761655, 1.3286444309174914, 1.323170899227622, 1.3181691588445197, 1.3184664436640334, 1.318293040102702, 1.3238724222442682, 1.3601216766554785, 1.3395306867947354, 1.3290286565120697, 1.3236741274998955, 1.318633896753293, 1.3134751321324272, 1.3132020634442203, 1.3077959946944353, 1.3030329186405918, 1.3033573559038203, 1.3034100438655642, 1.2978870806495706, 1.2980735056918902, 1.293463613844243, 1.288003392619118, 1.2874525221379407, 1.3090153642307354, 1.3250793286429356]}, {\"axis\": {\"matches\": true}, \"label\": \"Cumulated_T\", \"values\": [3346.937, 6675.764999999999, 9985.187, 13294.905999999999, 16602.593999999997, 19911.843999999997, 23220.265999999996, 26511.749999999996, 29801.640999999996, 33091.829, 36382.063, 39653.079, 42923.892, 46194.204, 49445.267, 52695.252, 55945.69, 59196.784, 62447.55, 65777.596, 69108.76800000001, 72420.11200000001, 75712.64400000001, 79003.81600000002, 82296.00300000003, 85567.34700000002, 88840.01900000003, 92110.94100000004, 95361.86300000004, 98615.09700000004, 101941.67500000003, 105230.86200000004, 108501.03400000004, 111752.42500000005, 114995.44000000005, 118228.61200000005, 121442.58100000005, 124646.83100000005, 127833.23700000005, 131019.00300000006, 134195.76900000006, 137362.69100000005, 140550.67500000005, 143718.34600000005, 146866.70500000005, 149996.98600000003, 153117.20500000005, 156340.50200000004, 159545.15900000004, 162721.67500000005, 165879.83100000003, 169019.61200000002, 172149.97100000002, 175270.76700000002, 178373.54900000003, 181457.53300000002, 184531.78300000002, 187597.59500000003, 190653.48500000004, 193699.39100000006, 196727.82800000007, 199737.57800000007, 202747.46900000007, 205738.76600000006, 208720.86000000004, 211693.82900000006, 214647.06400000004, 217591.50100000005, 220526.62600000005, 223453.01700000005, 226369.15800000005, 229265.97100000005, 232154.15900000004, 235033.50300000006, 237893.23800000004, 240743.94100000005, 243593.77000000005, 246462.44200000004, 249294.41100000005, 252108.00500000006, 254912.28600000005, 257715.73900000006, 260510.78600000005, 263295.50500000006, 266061.58300000004, 268809.33300000004, 271557.44200000004, 274295.67600000004, 277024.58200000005, 279911.20700000005, 282722.6290000001, 285506.34800000006, 288262.03500000003, 291008.01900000003, 293736.14400000003, 296454.94100000005, 299163.86300000007, 301864.2850000001, 304545.4260000001, 307217.7690000001, 309880.59700000007, 312533.6440000001, 315205.7540000001, 317896.0830000001, 320559.0360000001, 323202.38000000006, 325817.6770000001, 328432.53700000007, 331049.03700000007, 333655.53700000007, 336243.3190000001, 338821.14700000006, 341399.0850000001, 343967.67900000006, 346527.3670000001, 349077.4760000001, 351618.2420000001, 354159.0390000001, 356690.7110000001, 359268.64900000015, 361855.6960000002, 364405.3520000002, 366936.6650000002, 369457.60300000024, 371970.3060000002, 374473.5090000002, 376967.7440000002, 379451.6500000002, 381926.2750000002, 384392.2900000002, 386858.3840000002, 389314.3370000002, 391789.39900000015, 394283.49200000014, 396748.55500000017, 399204.4610000002, 401641.66400000016, 404079.38300000015, 406517.22700000013, 408945.61800000013, 411364.8360000001, 413774.38300000015, 416183.68000000017, 418584.53900000016, 420976.00800000015, 423357.50800000015, 425729.88300000015, 428102.4610000001, 430474.97700000013, 432857.35200000013, 435304.61800000013, 437715.00800000015, 440106.74300000013, 442489.02400000015, 444862.28900000016, 447226.1950000002, 449589.7420000002, 451943.5240000002, 454288.6180000002, 456634.4310000002, 458980.4470000002, 461316.5410000002, 463652.7750000002, 465980.3530000002, 468298.4620000002, 470615.4000000002, 472971.0090000002, 475354.9620000002]}], \"hoverlabel\": {\"namelength\": 0}, \"hovertemplate\": \"%{xaxis.title.text}=%{x}<br>%{yaxis.title.text}=%{y}\", \"legendgroup\": \"\", \"marker\": {\"color\": \"crimson\", \"size\": 2, \"symbol\": \"square\"}, \"name\": \"\", \"showlegend\": false, \"type\": \"splom\"}],\n",
              "                        {\"dragmode\": \"select\", \"font\": {\"size\": 7}, \"height\": 1200, \"legend\": {\"tracegroupgap\": 0}, \"margin\": {\"t\": 60}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"#f2f8fd\", \"template\": {\"data\": {\"bar\": [{\"error_x\": {\"color\": \"#2a3f5f\"}, \"error_y\": {\"color\": \"#2a3f5f\"}, \"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"bar\"}], \"barpolar\": [{\"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"baxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"choropleth\"}], \"contour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"contour\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"contourcarpet\"}], \"heatmap\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmap\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmapgl\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"histogram\"}], \"histogram2d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2d\"}], \"histogram2dcontour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2dcontour\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"parcoords\"}], \"pie\": [{\"automargin\": true, \"type\": \"pie\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter\"}], \"scatter3d\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattermapbox\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolar\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolargl\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"#EBF0F8\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"#C8D4E3\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowcolor\": \"#2a3f5f\", \"arrowhead\": 0, \"arrowwidth\": 1}, \"coloraxis\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"colorscale\": {\"diverging\": [[0, \"#8e0152\"], [0.1, \"#c51b7d\"], [0.2, \"#de77ae\"], [0.3, \"#f1b6da\"], [0.4, \"#fde0ef\"], [0.5, \"#f7f7f7\"], [0.6, \"#e6f5d0\"], [0.7, \"#b8e186\"], [0.8, \"#7fbc41\"], [0.9, \"#4d9221\"], [1, \"#276419\"]], \"sequential\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"sequentialminus\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]]}, \"colorway\": [\"#636efa\", \"#EF553B\", \"#00cc96\", \"#ab63fa\", \"#FFA15A\", \"#19d3f3\", \"#FF6692\", \"#B6E880\", \"#FF97FF\", \"#FECB52\"], \"font\": {\"color\": \"#2a3f5f\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"white\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"#C8D4E3\"}, \"hoverlabel\": {\"align\": \"left\"}, \"hovermode\": \"closest\", \"mapbox\": {\"style\": \"light\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"white\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"radialaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"yaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"zaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}}, \"shapedefaults\": {\"line\": {\"color\": \"#2a3f5f\"}}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"baxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"caxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}}, \"title\": {\"x\": 0.05}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}}}, \"title\": {\"text\": \"Battery dataset\"}, \"width\": 900},\n",
              "                        {\"responsive\": true}\n",
              "                    ).then(function(){\n",
              "                            \n",
              "var gd = document.getElementById('4bd7bdfc-750e-42ec-920f-038f8194f3c3');\n",
              "var x = new MutationObserver(function (mutations, observer) {{\n",
              "        var display = window.getComputedStyle(gd).display;\n",
              "        if (!display || display === 'none') {{\n",
              "            console.log([gd, 'removed!']);\n",
              "            Plotly.purge(gd);\n",
              "            observer.disconnect();\n",
              "        }}\n",
              "}});\n",
              "\n",
              "// Listen for the removal of the full notebook cells\n",
              "var notebookContainer = gd.closest('#notebook-container');\n",
              "if (notebookContainer) {{\n",
              "    x.observe(notebookContainer, {childList: true});\n",
              "}}\n",
              "\n",
              "// Listen for the clearing of the current output cell\n",
              "var outputEl = gd.closest('.output');\n",
              "if (outputEl) {{\n",
              "    x.observe(outputEl, {childList: true});\n",
              "}}\n",
              "\n",
              "                        })\n",
              "                };\n",
              "                \n",
              "            </script>\n",
              "        </div>\n",
              "</body>\n",
              "</html>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 542
        },
        "id": "bmLhWPg6Dnzk",
        "outputId": "1a350f6d-dd02-4b61-fbb8-404ba9510ecc"
      },
      "source": [
        "fig = go.Figure()\n",
        "\n",
        "fig.add_trace(go.Scatter(x=dfb['Cumulated_T']/3600, \n",
        "                         y=dfb['Capacity'],\n",
        "                         mode='lines',\n",
        "                         name='Capacity',\n",
        "                         marker_size=3, \n",
        "                         line=dict(color='crimson', width=3)    \n",
        "                        ))\n",
        "fig.update_layout(\n",
        "                  title=\"Battery discharge capacity\",\n",
        "                  xaxis_title=\"Working time [hours]\",\n",
        "                  yaxis_title=f\"Battery capacity in Ahr\"\n",
        "    )\n",
        "fig.update_layout({'plot_bgcolor': '#f2f8fd',\n",
        "                   'paper_bgcolor': 'white',}, \n",
        "                    template='plotly_white')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<html>\n",
              "<head><meta charset=\"utf-8\" /></head>\n",
              "<body>\n",
              "    <div>\n",
              "            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>\n",
              "                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
              "        <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>    \n",
              "            <div id=\"17e3ebb0-e301-4c8a-b754-34da2c2483bf\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>\n",
              "            <script type=\"text/javascript\">\n",
              "                \n",
              "                    window.PLOTLYENV=window.PLOTLYENV || {};\n",
              "                    \n",
              "                if (document.getElementById(\"17e3ebb0-e301-4c8a-b754-34da2c2483bf\")) {\n",
              "                    Plotly.newPlot(\n",
              "                        '17e3ebb0-e301-4c8a-b754-34da2c2483bf',\n",
              "                        [{\"line\": {\"color\": \"crimson\", \"width\": 3}, \"marker\": {\"size\": 3}, \"mode\": \"lines\", \"name\": \"Capacity\", \"type\": \"scatter\", \"x\": [0.9297047222222222, 1.8543791666666665, 2.7736630555555557, 3.693029444444444, 4.611831666666666, 5.5310677777777775, 6.4500738888888876, 7.364374999999999, 8.27823361111111, 9.192174722222221, 10.106128611111112, 11.014744166666667, 11.923303333333333, 12.831723333333333, 13.734796388888888, 14.63757, 15.540469444444446, 16.443551111111113, 17.346541666666667, 18.271554444444448, 19.196880000000004, 20.11669777777778, 21.031290000000006, 21.94550444444445, 22.86000083333334, 23.768707500000005, 24.677783055555565, 25.58637250000001, 26.4894063888889, 27.39308250000001, 28.317131944444455, 29.23079500000001, 30.139176111111123, 31.04234027777779, 31.94317777777779, 32.84128111111112, 33.73405027777779, 34.62411972222223, 35.50923250000002, 36.394167500000016, 37.27660250000002, 38.15630305555557, 39.04185416666668, 39.92176277777779, 40.79630694444446, 41.665829444444455, 42.53255694444446, 43.427917222222234, 44.318099722222236, 45.20046527777779, 46.07773083333334, 46.94989222222223, 47.819436388888896, 48.68632416666667, 49.54820805555556, 50.40487027777778, 51.25882861111112, 52.110443055555564, 52.9593013888889, 53.805386388888905, 54.64661888888891, 55.482660555555576, 56.31874138888891, 57.14965722222224, 57.978016666666676, 58.803841388888905, 59.62418444444446, 60.44208361111112, 61.25739611111113, 62.07028250000001, 62.88032166666668, 63.684991944444455, 64.4872663888889, 65.28708416666669, 66.081455, 66.87331694444445, 67.66493611111112, 68.46178944444445, 69.24844750000001, 70.0300013888889, 70.80896833333335, 71.5877052777778, 72.36410722222223, 73.13764027777779, 73.90599527777779, 74.66925916666668, 75.4326227777778, 76.19324333333334, 76.95127277777779, 77.75311305555557, 78.53406361111114, 79.3073188888889, 80.0727875, 80.83556083333335, 81.59337333333335, 82.34859472222223, 83.10107305555557, 83.8511902777778, 84.59595166666669, 85.33826916666669, 86.07794361111112, 86.81490111111114, 87.5571538888889, 88.30446750000003, 89.04417666666669, 89.7784388888889, 90.5049102777778, 91.23126027777779, 91.95806583333335, 92.68209361111113, 93.40092194444446, 94.11698527777779, 94.83307916666669, 95.54657750000001, 96.25760194444447, 96.96596555555558, 97.67173388888891, 98.37751083333336, 99.08075305555559, 99.79684694444448, 100.51547111111115, 101.22370888888894, 101.92685138888895, 102.62711194444451, 103.32508500000006, 104.02041916666673, 104.71326222222227, 105.40323611111117, 106.0906319444445, 106.77563611111117, 107.46066222222228, 108.14287138888893, 108.83038861111115, 109.52319222222226, 110.2079319444445, 110.8901280555556, 111.56712888888893, 112.2442730555556, 112.92145194444448, 113.59600500000003, 114.26801000000003, 114.93732861111116, 115.60657777777783, 116.2734830555556, 116.93778000000005, 117.59930777777782, 118.25830083333338, 118.91735027777781, 119.57638250000004, 120.23815333333337, 120.91794944444449, 121.58750222222227, 122.25187305555559, 122.91361777777782, 123.5728580555556, 124.22949861111117, 124.8860394444445, 125.53986777777783, 126.19128277777783, 126.84289750000006, 127.49456861111118, 128.14348361111118, 128.79243750000006, 129.43898694444448, 130.08290611111116, 130.72650000000004, 131.38083583333338, 132.04304500000003], \"y\": [1.8564874208181568, 1.8463272497199268, 1.835349194223408, 1.8352625275821128, 1.8346455082120416, 1.8356616600675493, 1.8351461429226603, 1.8257567905665533, 1.8247738529891333, 1.824613268496936, 1.8246195526864504, 1.814201935767392, 1.8137521577549047, 1.8134404914735824, 1.8025980036306504, 1.8021069002461496, 1.8025795008262089, 1.8030683142834096, 1.802777624719604, 1.8470259949329195, 1.847417311283644, 1.8361774213478947, 1.825780747577624, 1.8251136435078368, 1.825581504220376, 1.814031127508391, 1.8147691941158937, 1.8139693887103518, 1.8027656651678232, 1.8040770401173518, 1.8518025516704488, 1.8307038456739428, 1.8199041089501269, 1.809307963702852, 1.8046099045805202, 1.7993770651972192, 1.7884432335370462, 1.7829230484252725, 1.7730337158018288, 1.773037755078937, 1.7678721106662054, 1.762315070409309, 1.7676172924938447, 1.762668359743147, 1.7517304870664143, 1.7418496047960008, 1.7360913511847138, 1.7936240148573608, 1.7831890223273277, 1.7673642076278957, 1.7570177850353066, 1.7468706179837907, 1.7417172507457144, 1.7364225056478186, 1.7263217239235826, 1.7158065389330133, 1.710533351135192, 1.706014499648521, 1.7003110272642588, 1.6945798601797897, 1.6849029086609286, 1.6744741591159715, 1.6745692479879102, 1.663716375981405, 1.6590138687482459, 1.6538540573335014, 1.6426537821301308, 1.6378578430223698, 1.6327350407099108, 1.6277528915533617, 1.622125485521159, 1.6113256603765849, 1.6065631397488385, 1.6015142233917594, 1.590369231400328, 1.5857889968242211, 1.5849430707374117, 1.5955263892495937, 1.5747301747801037, 1.5649019950937946, 1.5597659473370362, 1.5594815668184234, 1.5546893535906101, 1.5488741079890418, 1.5382365989425582, 1.5279142582510281, 1.5285252629756445, 1.5226473252843782, 1.5174859938489869, 1.605818899130659, 1.5638491446744425, 1.5480915247767786, 1.5323755631868592, 1.5269528268489705, 1.5169573017136326, 1.511897596014269, 1.5065638960681105, 1.5015453526671363, 1.4908444050400238, 1.485868384561201, 1.480413677976106, 1.4752095869031632, 1.4859035988304024, 1.4960918298136696, 1.4808005946928984, 1.4697543268466824, 1.4539012274845928, 1.454146206723569, 1.455023751906683, 1.4490421637612358, 1.4386709371480566, 1.4334454321569792, 1.4333958900838095, 1.4280648734477601, 1.4229203181741186, 1.417429032731308, 1.412409228794446, 1.4125787929401932, 1.4075983731469897, 1.4333920485221476, 1.4382550176792908, 1.4173547174485526, 1.4069816636776429, 1.4012037783587623, 1.3967008232726328, 1.391284788852726, 1.3862287677978349, 1.3804366761974138, 1.3752364150256224, 1.3705128024895008, 1.37050855662704, 1.3647355108681518, 1.375392016895762, 1.3861115151535393, 1.369850003583894, 1.3647827949260758, 1.3543220466259964, 1.3546417018378962, 1.354703921319241, 1.349314997503458, 1.3441891937970554, 1.3389913790695755, 1.3389145230206971, 1.3340066759761655, 1.3286444309174914, 1.323170899227622, 1.3181691588445197, 1.3184664436640334, 1.318293040102702, 1.3238724222442682, 1.3601216766554785, 1.3395306867947354, 1.3290286565120697, 1.3236741274998955, 1.318633896753293, 1.3134751321324272, 1.3132020634442203, 1.3077959946944353, 1.3030329186405918, 1.3033573559038203, 1.3034100438655642, 1.2978870806495706, 1.2980735056918902, 1.293463613844243, 1.288003392619118, 1.2874525221379407, 1.3090153642307354, 1.3250793286429356]}],\n",
              "                        {\"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"#f2f8fd\", \"template\": {\"data\": {\"bar\": [{\"error_x\": {\"color\": \"#2a3f5f\"}, \"error_y\": {\"color\": \"#2a3f5f\"}, \"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"bar\"}], \"barpolar\": [{\"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"baxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"choropleth\"}], \"contour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"contour\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"contourcarpet\"}], \"heatmap\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmap\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmapgl\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"histogram\"}], \"histogram2d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2d\"}], \"histogram2dcontour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2dcontour\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"parcoords\"}], \"pie\": [{\"automargin\": true, \"type\": \"pie\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter\"}], \"scatter3d\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattermapbox\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolar\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolargl\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"#EBF0F8\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"#C8D4E3\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowcolor\": \"#2a3f5f\", \"arrowhead\": 0, \"arrowwidth\": 1}, \"coloraxis\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"colorscale\": {\"diverging\": [[0, \"#8e0152\"], [0.1, \"#c51b7d\"], [0.2, \"#de77ae\"], [0.3, \"#f1b6da\"], [0.4, \"#fde0ef\"], [0.5, \"#f7f7f7\"], [0.6, \"#e6f5d0\"], [0.7, \"#b8e186\"], [0.8, \"#7fbc41\"], [0.9, \"#4d9221\"], [1, \"#276419\"]], \"sequential\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"sequentialminus\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]]}, \"colorway\": [\"#636efa\", \"#EF553B\", \"#00cc96\", \"#ab63fa\", \"#FFA15A\", \"#19d3f3\", \"#FF6692\", \"#B6E880\", \"#FF97FF\", \"#FECB52\"], \"font\": {\"color\": \"#2a3f5f\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"white\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"#C8D4E3\"}, \"hoverlabel\": {\"align\": \"left\"}, \"hovermode\": \"closest\", \"mapbox\": {\"style\": \"light\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"white\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"radialaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"yaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"zaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}}, \"shapedefaults\": {\"line\": {\"color\": \"#2a3f5f\"}}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"baxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"caxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}}, \"title\": {\"x\": 0.05}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}}}, \"title\": {\"text\": \"Battery discharge capacity\"}, \"xaxis\": {\"title\": {\"text\": \"Working time [hours]\"}}, \"yaxis\": {\"title\": {\"text\": \"Battery capacity in Ahr\"}}},\n",
              "                        {\"responsive\": true}\n",
              "                    ).then(function(){\n",
              "                            \n",
              "var gd = document.getElementById('17e3ebb0-e301-4c8a-b754-34da2c2483bf');\n",
              "var x = new MutationObserver(function (mutations, observer) {{\n",
              "        var display = window.getComputedStyle(gd).display;\n",
              "        if (!display || display === 'none') {{\n",
              "            console.log([gd, 'removed!']);\n",
              "            Plotly.purge(gd);\n",
              "            observer.disconnect();\n",
              "        }}\n",
              "}});\n",
              "\n",
              "// Listen for the removal of the full notebook cells\n",
              "var notebookContainer = gd.closest('#notebook-container');\n",
              "if (notebookContainer) {{\n",
              "    x.observe(notebookContainer, {childList: true});\n",
              "}}\n",
              "\n",
              "// Listen for the clearing of the current output cell\n",
              "var outputEl = gd.closest('.output');\n",
              "if (outputEl) {{\n",
              "    x.observe(outputEl, {childList: true});\n",
              "}}\n",
              "\n",
              "                        })\n",
              "                };\n",
              "                \n",
              "            </script>\n",
              "        </div>\n",
              "</body>\n",
              "</html>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "z4khX4N5wys7"
      },
      "source": [
        "### 2. Define a physical model"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "NhiMrtrkcpiR"
      },
      "source": [
        "Physical model according [1]. The basic equation is:<br>\n",
        "<center> $L = 1 − (1 − L' )e^{-f_d}$ </center><br>\n",
        "\n",
        "Where $L$ is the battery lifetime and $L'$ the initial battery lifetime. $f_d$ is a Linearized degradation rate per unit time and per cycle.  It can be described as:<br>\n",
        "<center> $f_d = f_d(t, δ, σ, T_c)$ </center><br> \n",
        "\n",
        "where $t$ is charging time, δ is the cycle depth of discharge, σ is the cycle average state of charge, and $T_c$ is cell temperature. The equation for baatery capacity could be written as follows:<br>\n",
        "<center> $C = C_0e^{f_d}$ </center><br>\n",
        "\n",
        "We have empirically found that $f_d$ aproximates to:\n",
        "<center> $f_d = \\frac{kT_Ci}{t}$ </center><br>\n",
        "\n",
        "where $k= $ 0.13, $i$ the cycle number and $t$ the charge time for every cycle.\n",
        "\n",
        "- [1] *Xu, Bolun & Oudalov, Alexandre & Ulbig, Andreas & Andersson, Göran & Kirschen, D.s. (2016). Modeling of Lithium-Ion Battery Degradation for Cell Life Assessment. IEEE Transactions on Smart Grid. 99. 1-1. 10.1109/TSG.2016.2578950.* "
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "rTU_ImZ1rPLf"
      },
      "source": [
        "from math import e\n",
        "L = (dfb['Capacity']-dfb['Capacity'].iloc[0:1].values[0])/-dfb['Capacity'].iloc[0:1].values[0]\n",
        "K = 0.13\n",
        "L_1 = 1-e**(-K*dfb.index*dfb['Temperature_measured']/(dfb['Time']))\n",
        "dfb['C. Capacity'] = -(L_1*dfb['Capacity'].iloc[0:1].values[0]) + dfb['Capacity'].iloc[0:1].values[0]"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 542
        },
        "id": "l8bmHjJQCBEe",
        "outputId": "0030b53e-9dde-449a-9f29-ba6606820c2e"
      },
      "source": [
        "fig = go.Figure()\n",
        "\n",
        "fig.add_trace(go.Scatter(x=dfb.index, \n",
        "                         y=dfb['C. Capacity'],\n",
        "                         mode='lines',\n",
        "                         name='Physical model',\n",
        "                         line=dict(color='navy', \n",
        "                                   width=2.5,\n",
        "                                   )))\n",
        "\n",
        "fig.add_trace(go.Scatter(x=dfb.index, \n",
        "                         y=dfb['Capacity'],\n",
        "                         mode='markers',\n",
        "                         marker=dict(\n",
        "                              size=4,\n",
        "                              color='grey',\n",
        "                              symbol='cross'\n",
        "                                 ),\n",
        "                         name='NASA dataset',\n",
        "                         line_color='navy'))\n",
        "fig.update_layout(\n",
        "    title=\"Physical model comparison \",\n",
        "    xaxis_title=\"Cycles\",\n",
        "    yaxis_title=\"𝐶, Capacity [Ahr]\")\n",
        "\n",
        "fig.update_layout(legend=dict(\n",
        "    yanchor=\"top\",\n",
        "    y=0.9,\n",
        "    xanchor=\"left\",\n",
        "    x=0.8\n",
        "))\n",
        "\n",
        "fig.update_layout({'plot_bgcolor': '#f2f8fd',\n",
        "                  'paper_bgcolor': 'white',}, \n",
        "                   template='plotly_white')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<html>\n",
              "<head><meta charset=\"utf-8\" /></head>\n",
              "<body>\n",
              "    <div>\n",
              "            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>\n",
              "                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
              "        <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>    \n",
              "            <div id=\"1bf9c21d-7ffd-487e-a4e5-a24be912e400\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>\n",
              "            <script type=\"text/javascript\">\n",
              "                \n",
              "                    window.PLOTLYENV=window.PLOTLYENV || {};\n",
              "                    \n",
              "                if (document.getElementById(\"1bf9c21d-7ffd-487e-a4e5-a24be912e400\")) {\n",
              "                    Plotly.newPlot(\n",
              "                        '1bf9c21d-7ffd-487e-a4e5-a24be912e400',\n",
              "                        [{\"line\": {\"color\": \"navy\", \"width\": 2.5}, \"mode\": \"lines\", \"name\": \"Physical model\", \"type\": \"scatter\", \"x\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168], \"y\": [1.8536842133171372, 1.850850402729868, 1.8480304675868555, 1.8452416845039394, 1.842473478835287, 1.8396524255157125, 1.8368269464109566, 1.8340507209620598, 1.831267470067291, 1.828503784093851, 1.825742611735947, 1.8227393050077814, 1.8199149036559383, 1.817197480276822, 1.8144683298457458, 1.8117243494578803, 1.8088474788820104, 1.8059154298004312, 1.803077368956457, 1.8016482343497668, 1.7982301806489422, 1.795843333042972, 1.793283620935947, 1.7906082695539571, 1.787809156394655, 1.7851032906279236, 1.7823094115171492, 1.7794658471810845, 1.776594140463695, 1.7736143377224274, 1.7720343040962534, 1.7684531684334275, 1.7656613026690162, 1.763351072193775, 1.7604664378279238, 1.7565710589137493, 1.7539143054193773, 1.75082215499336, 1.7481720933513072, 1.7444164793300367, 1.7398752500218797, 1.7365605809794031, 1.7354041890194971, 1.7327255958357504, 1.7303377784047618, 1.727086473691884, 1.7232150912459092, 1.7161029296467465, 1.715435290101237, 1.7138100876767175, 1.7114386688325567, 1.7086145559214938, 1.7047170939917946, 1.7002289346717998, 1.6977559338646548, 1.6939607497627964, 1.691294032444433, 1.686862146400443, 1.6828054656145022, 1.6797788509402931, 1.6763082874834179, 1.673152061105374, 1.66831671020391, 1.6657666270521303, 1.660698932143747, 1.6570796930830114, 1.6537832663404595, 1.6499092083522247, 1.645914111885159, 1.6420511744703306, 1.6380513854243808, 1.6346026896147958, 1.630398623212987, 1.6265075909161366, 1.6229797068754155, 1.6190503953353337, 1.6169663604275857, 1.6134017267272935, 1.6100932526321914, 1.6065773925745437, 1.6016314523984518, 1.59528055220688, 1.590794383858618, 1.5870486815167304, 1.5842185401928082, 1.580834067454341, 1.575222345473598, 1.5700561908643627, 1.565724769317052, 1.5787517003090084, 1.566406644872898, 1.5604799643853628, 1.5566622675566837, 1.5527629400599507, 1.548713568685512, 1.5438138452833383, 1.5395054950721865, 1.5352168877525205, 1.530776487688899, 1.5263216773823127, 1.521877766243235, 1.5176745072050215, 1.5159723241564347, 1.5118595340890693, 1.505702328364038, 1.5015089909991184, 1.4963431778687801, 1.4931144576721218, 1.487536219041169, 1.482084487511379, 1.479376979935184, 1.4756704295136052, 1.4699265118341525, 1.464267380722019, 1.4608702741491437, 1.4576039218856538, 1.4541747520849344, 1.4485654626627722, 1.442305974540704, 1.4483095477557382, 1.4449334534024794, 1.4395359688144573, 1.4360401050273368, 1.431318390134512, 1.4267212951376773, 1.4223693732558793, 1.4180786570876263, 1.4143528051397996, 1.4103765774337609, 1.405137486611523, 1.4013341823343977, 1.3972965463371347, 1.3939702258137434, 1.3930954905793484, 1.3862182336675275, 1.3816997290230144, 1.3786204372635644, 1.3718504490530294, 1.3668108144066167, 1.3641820993725786, 1.3618378449094168, 1.3576118429666406, 1.3514619258484795, 1.3476841165148965, 1.344667534145667, 1.3420425677315664, 1.3379154409489669, 1.331147411045945, 1.3283516904566741, 1.3324149085603154, 1.3372631078128312, 1.3275722777315915, 1.3228287548956155, 1.3184560436329402, 1.3139239578940467, 1.3093075231948292, 1.305550901999312, 1.3014179686253438, 1.2970055930259634, 1.2927751002061323, 1.2885111714900441, 1.2839692698581224, 1.2808262054065005, 1.2768250879383842, 1.2720399623004237, 1.2679457473011821, 1.273038936061159, 1.2766378466591837]}, {\"line\": {\"color\": \"navy\"}, \"marker\": {\"color\": \"grey\", \"size\": 4, \"symbol\": \"cross\"}, \"mode\": \"markers\", \"name\": \"NASA dataset\", \"type\": \"scatter\", \"x\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168], \"y\": [1.8564874208181568, 1.8463272497199268, 1.835349194223408, 1.8352625275821128, 1.8346455082120416, 1.8356616600675493, 1.8351461429226603, 1.8257567905665533, 1.8247738529891333, 1.824613268496936, 1.8246195526864504, 1.814201935767392, 1.8137521577549047, 1.8134404914735824, 1.8025980036306504, 1.8021069002461496, 1.8025795008262089, 1.8030683142834096, 1.802777624719604, 1.8470259949329195, 1.847417311283644, 1.8361774213478947, 1.825780747577624, 1.8251136435078368, 1.825581504220376, 1.814031127508391, 1.8147691941158937, 1.8139693887103518, 1.8027656651678232, 1.8040770401173518, 1.8518025516704488, 1.8307038456739428, 1.8199041089501269, 1.809307963702852, 1.8046099045805202, 1.7993770651972192, 1.7884432335370462, 1.7829230484252725, 1.7730337158018288, 1.773037755078937, 1.7678721106662054, 1.762315070409309, 1.7676172924938447, 1.762668359743147, 1.7517304870664143, 1.7418496047960008, 1.7360913511847138, 1.7936240148573608, 1.7831890223273277, 1.7673642076278957, 1.7570177850353066, 1.7468706179837907, 1.7417172507457144, 1.7364225056478186, 1.7263217239235826, 1.7158065389330133, 1.710533351135192, 1.706014499648521, 1.7003110272642588, 1.6945798601797897, 1.6849029086609286, 1.6744741591159715, 1.6745692479879102, 1.663716375981405, 1.6590138687482459, 1.6538540573335014, 1.6426537821301308, 1.6378578430223698, 1.6327350407099108, 1.6277528915533617, 1.622125485521159, 1.6113256603765849, 1.6065631397488385, 1.6015142233917594, 1.590369231400328, 1.5857889968242211, 1.5849430707374117, 1.5955263892495937, 1.5747301747801037, 1.5649019950937946, 1.5597659473370362, 1.5594815668184234, 1.5546893535906101, 1.5488741079890418, 1.5382365989425582, 1.5279142582510281, 1.5285252629756445, 1.5226473252843782, 1.5174859938489869, 1.605818899130659, 1.5638491446744425, 1.5480915247767786, 1.5323755631868592, 1.5269528268489705, 1.5169573017136326, 1.511897596014269, 1.5065638960681105, 1.5015453526671363, 1.4908444050400238, 1.485868384561201, 1.480413677976106, 1.4752095869031632, 1.4859035988304024, 1.4960918298136696, 1.4808005946928984, 1.4697543268466824, 1.4539012274845928, 1.454146206723569, 1.455023751906683, 1.4490421637612358, 1.4386709371480566, 1.4334454321569792, 1.4333958900838095, 1.4280648734477601, 1.4229203181741186, 1.417429032731308, 1.412409228794446, 1.4125787929401932, 1.4075983731469897, 1.4333920485221476, 1.4382550176792908, 1.4173547174485526, 1.4069816636776429, 1.4012037783587623, 1.3967008232726328, 1.391284788852726, 1.3862287677978349, 1.3804366761974138, 1.3752364150256224, 1.3705128024895008, 1.37050855662704, 1.3647355108681518, 1.375392016895762, 1.3861115151535393, 1.369850003583894, 1.3647827949260758, 1.3543220466259964, 1.3546417018378962, 1.354703921319241, 1.349314997503458, 1.3441891937970554, 1.3389913790695755, 1.3389145230206971, 1.3340066759761655, 1.3286444309174914, 1.323170899227622, 1.3181691588445197, 1.3184664436640334, 1.318293040102702, 1.3238724222442682, 1.3601216766554785, 1.3395306867947354, 1.3290286565120697, 1.3236741274998955, 1.318633896753293, 1.3134751321324272, 1.3132020634442203, 1.3077959946944353, 1.3030329186405918, 1.3033573559038203, 1.3034100438655642, 1.2978870806495706, 1.2980735056918902, 1.293463613844243, 1.288003392619118, 1.2874525221379407, 1.3090153642307354, 1.3250793286429356]}],\n",
              "                        {\"legend\": {\"x\": 0.8, \"xanchor\": \"left\", \"y\": 0.9, \"yanchor\": \"top\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"#f2f8fd\", \"template\": {\"data\": {\"bar\": [{\"error_x\": {\"color\": \"#2a3f5f\"}, \"error_y\": {\"color\": \"#2a3f5f\"}, \"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"bar\"}], \"barpolar\": [{\"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"baxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"choropleth\"}], \"contour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"contour\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"contourcarpet\"}], \"heatmap\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmap\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmapgl\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"histogram\"}], \"histogram2d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2d\"}], \"histogram2dcontour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2dcontour\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"parcoords\"}], \"pie\": [{\"automargin\": true, \"type\": \"pie\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter\"}], \"scatter3d\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattermapbox\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolar\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolargl\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"#EBF0F8\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"#C8D4E3\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowcolor\": \"#2a3f5f\", \"arrowhead\": 0, \"arrowwidth\": 1}, \"coloraxis\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"colorscale\": {\"diverging\": [[0, \"#8e0152\"], [0.1, \"#c51b7d\"], [0.2, \"#de77ae\"], [0.3, \"#f1b6da\"], [0.4, \"#fde0ef\"], [0.5, \"#f7f7f7\"], [0.6, \"#e6f5d0\"], [0.7, \"#b8e186\"], [0.8, \"#7fbc41\"], [0.9, \"#4d9221\"], [1, \"#276419\"]], \"sequential\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"sequentialminus\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]]}, \"colorway\": [\"#636efa\", \"#EF553B\", \"#00cc96\", \"#ab63fa\", \"#FFA15A\", \"#19d3f3\", \"#FF6692\", \"#B6E880\", \"#FF97FF\", \"#FECB52\"], \"font\": {\"color\": \"#2a3f5f\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"white\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"#C8D4E3\"}, \"hoverlabel\": {\"align\": \"left\"}, \"hovermode\": \"closest\", \"mapbox\": {\"style\": \"light\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"white\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"radialaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"yaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"zaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}}, \"shapedefaults\": {\"line\": {\"color\": \"#2a3f5f\"}}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"baxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"caxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}}, \"title\": {\"x\": 0.05}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}}}, \"title\": {\"text\": \"Physical model comparison \"}, \"xaxis\": {\"title\": {\"text\": \"Cycles\"}}, \"yaxis\": {\"title\": {\"text\": \"\\ud835\\udc36, Capacity [Ahr]\"}}},\n",
              "                        {\"responsive\": true}\n",
              "                    ).then(function(){\n",
              "                            \n",
              "var gd = document.getElementById('1bf9c21d-7ffd-487e-a4e5-a24be912e400');\n",
              "var x = new MutationObserver(function (mutations, observer) {{\n",
              "        var display = window.getComputedStyle(gd).display;\n",
              "        if (!display || display === 'none') {{\n",
              "            console.log([gd, 'removed!']);\n",
              "            Plotly.purge(gd);\n",
              "            observer.disconnect();\n",
              "        }}\n",
              "}});\n",
              "\n",
              "// Listen for the removal of the full notebook cells\n",
              "var notebookContainer = gd.closest('#notebook-container');\n",
              "if (notebookContainer) {{\n",
              "    x.observe(notebookContainer, {childList: true});\n",
              "}}\n",
              "\n",
              "// Listen for the clearing of the current output cell\n",
              "var outputEl = gd.closest('.output');\n",
              "if (outputEl) {{\n",
              "    x.observe(outputEl, {childList: true});\n",
              "}}\n",
              "\n",
              "                        })\n",
              "                };\n",
              "                \n",
              "            </script>\n",
              "        </div>\n",
              "</body>\n",
              "</html>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "GaZ8opJqS2Sx"
      },
      "source": [
        "### 3. Compare experimental data with physical model"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "0jRN6RyZxMvG",
        "outputId": "22590dfb-0d36-453b-a065-9117fe84aa81"
      },
      "source": [
        "# Mean Absolute Error\n",
        "M = pd.DataFrame()\n",
        "S = pd.DataFrame()\n",
        "def MAE(M,S):    \n",
        "    return np.sum(S-M)/len(S)\n",
        "\n",
        "print(f'Mean Absolute Error =', round(MAE(dfb['Capacity'], dfb['C. Capacity']), 3))"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Mean Absolute Error = 0.004\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "MQj67klQS2S0"
      },
      "source": [
        "### 4. Hybrid digital twin "
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "P4tOwrSYS2S0"
      },
      "source": [
        "#Define inputs and outputs\n",
        "X_in = dfb['C. Capacity']          # input: the simulation time series\n",
        "X_out = dfb['Capacity'] - dfb['C. Capacity']   # output: difference between measurement and simulation\n",
        "\n",
        "X_in_train, X_in_test, X_out_train, X_out_test = train_test_split(X_in, X_out, test_size=0.33)"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "r4RzAol2J8or",
        "outputId": "d096e003-658c-4c95-c759-3e315ade8d63"
      },
      "source": [
        "X_in_train.shape"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(112,)"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 10
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "dnfxtbRqF1V6"
      },
      "source": [
        "#The Dense function in Keras constructs a fully connected neural network layer, automatically initializing the weights as biases.\n",
        "#First hidden layer\n",
        "model = Sequential()\n",
        "model.add(Dense(64, activation='relu'))\n",
        "model.add(Dense(64, activation='relu'))\n",
        "model.add(Dense(1))"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "xpWJebynF6uZ",
        "outputId": "bcc5ab35-7be1-491c-a89f-db29f12638e5"
      },
      "source": [
        "epochs = 100\n",
        "loss = \"mse\"\n",
        "model.compile(optimizer='adam',\n",
        "              loss=loss,\n",
        "              metrics=['mae'], #Mean Absolute Error\n",
        "             )\n",
        "history = model.fit(X_in_train, X_out_train, \n",
        "                    shuffle=True, \n",
        "                    epochs=epochs,\n",
        "                    batch_size=20,\n",
        "                    validation_data=(X_in_test, X_out_test), \n",
        "                    verbose=1)"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Epoch 1/100\n",
            "6/6 [==============================] - 22s 167ms/step - loss: 0.0073 - mae: 0.0724 - val_loss: 0.0029 - val_mae: 0.0441\n",
            "Epoch 2/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 0.0020 - mae: 0.0367 - val_loss: 0.0030 - val_mae: 0.0478\n",
            "Epoch 3/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 0.0019 - mae: 0.0379 - val_loss: 0.0021 - val_mae: 0.0354\n",
            "Epoch 4/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 0.0016 - mae: 0.0319 - val_loss: 0.0011 - val_mae: 0.0289\n",
            "Epoch 5/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 0.0011 - mae: 0.0288 - val_loss: 8.8750e-04 - val_mae: 0.0258\n",
            "Epoch 6/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 8.6720e-04 - mae: 0.0241 - val_loss: 9.3450e-04 - val_mae: 0.0255\n",
            "Epoch 7/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.7068e-04 - mae: 0.0238 - val_loss: 9.3880e-04 - val_mae: 0.0270\n",
            "Epoch 8/100\n",
            "6/6 [==============================] - 0s 10ms/step - loss: 7.6818e-04 - mae: 0.0235 - val_loss: 9.1910e-04 - val_mae: 0.0254\n",
            "Epoch 9/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.8089e-04 - mae: 0.0221 - val_loss: 9.1008e-04 - val_mae: 0.0266\n",
            "Epoch 10/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.3556e-04 - mae: 0.0235 - val_loss: 8.7510e-04 - val_mae: 0.0254\n",
            "Epoch 11/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.5666e-04 - mae: 0.0227 - val_loss: 8.7445e-04 - val_mae: 0.0258\n",
            "Epoch 12/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.2720e-04 - mae: 0.0231 - val_loss: 8.7741e-04 - val_mae: 0.0260\n",
            "Epoch 13/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 8.0716e-04 - mae: 0.0245 - val_loss: 8.7129e-04 - val_mae: 0.0253\n",
            "Epoch 14/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 8.9908e-04 - mae: 0.0232 - val_loss: 8.6374e-04 - val_mae: 0.0255\n",
            "Epoch 15/100\n",
            "6/6 [==============================] - 0s 10ms/step - loss: 8.0920e-04 - mae: 0.0242 - val_loss: 8.6269e-04 - val_mae: 0.0253\n",
            "Epoch 16/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.7771e-04 - mae: 0.0231 - val_loss: 8.6120e-04 - val_mae: 0.0257\n",
            "Epoch 17/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.4492e-04 - mae: 0.0228 - val_loss: 8.5888e-04 - val_mae: 0.0257\n",
            "Epoch 18/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.1863e-04 - mae: 0.0222 - val_loss: 8.5531e-04 - val_mae: 0.0254\n",
            "Epoch 19/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.0377e-04 - mae: 0.0223 - val_loss: 8.5408e-04 - val_mae: 0.0253\n",
            "Epoch 20/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 7.0186e-04 - mae: 0.0217 - val_loss: 8.7235e-04 - val_mae: 0.0264\n",
            "Epoch 21/100\n",
            "6/6 [==============================] - 0s 10ms/step - loss: 7.9355e-04 - mae: 0.0241 - val_loss: 8.7012e-04 - val_mae: 0.0250\n",
            "Epoch 22/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 6.9302e-04 - mae: 0.0206 - val_loss: 9.7644e-04 - val_mae: 0.0278\n",
            "Epoch 23/100\n",
            "6/6 [==============================] - 0s 10ms/step - loss: 8.7732e-04 - mae: 0.0255 - val_loss: 9.7150e-04 - val_mae: 0.0252\n",
            "Epoch 24/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.9624e-04 - mae: 0.0228 - val_loss: 9.6106e-04 - val_mae: 0.0277\n",
            "Epoch 25/100\n",
            "6/6 [==============================] - 0s 10ms/step - loss: 8.3275e-04 - mae: 0.0243 - val_loss: 9.0669e-04 - val_mae: 0.0250\n",
            "Epoch 26/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.3055e-04 - mae: 0.0209 - val_loss: 9.4628e-04 - val_mae: 0.0275\n",
            "Epoch 27/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 8.2731e-04 - mae: 0.0250 - val_loss: 9.1348e-04 - val_mae: 0.0249\n",
            "Epoch 28/100\n",
            "6/6 [==============================] - 0s 10ms/step - loss: 8.7785e-04 - mae: 0.0229 - val_loss: 8.5502e-04 - val_mae: 0.0262\n",
            "Epoch 29/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.4989e-04 - mae: 0.0229 - val_loss: 8.3938e-04 - val_mae: 0.0255\n",
            "Epoch 30/100\n",
            "6/6 [==============================] - 0s 12ms/step - loss: 7.9248e-04 - mae: 0.0237 - val_loss: 8.5845e-04 - val_mae: 0.0249\n",
            "Epoch 31/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 7.7327e-04 - mae: 0.0213 - val_loss: 8.9804e-04 - val_mae: 0.0270\n",
            "Epoch 32/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.2960e-04 - mae: 0.0235 - val_loss: 0.0010 - val_mae: 0.0254\n",
            "Epoch 33/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 8.1861e-04 - mae: 0.0218 - val_loss: 0.0011 - val_mae: 0.0288\n",
            "Epoch 34/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 8.8335e-04 - mae: 0.0247 - val_loss: 0.0011 - val_mae: 0.0258\n",
            "Epoch 35/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 9.8814e-04 - mae: 0.0242 - val_loss: 9.0522e-04 - val_mae: 0.0271\n",
            "Epoch 36/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.0212e-04 - mae: 0.0230 - val_loss: 9.1783e-04 - val_mae: 0.0250\n",
            "Epoch 37/100\n",
            "6/6 [==============================] - 0s 10ms/step - loss: 8.6581e-04 - mae: 0.0241 - val_loss: 8.5024e-04 - val_mae: 0.0250\n",
            "Epoch 38/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.5783e-04 - mae: 0.0221 - val_loss: 9.0157e-04 - val_mae: 0.0271\n",
            "Epoch 39/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 0.0010 - mae: 0.0265 - val_loss: 0.0014 - val_mae: 0.0287\n",
            "Epoch 40/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 9.4764e-04 - mae: 0.0240 - val_loss: 0.0013 - val_mae: 0.0303\n",
            "Epoch 41/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 0.0011 - mae: 0.0281 - val_loss: 8.8451e-04 - val_mae: 0.0249\n",
            "Epoch 42/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.4749e-04 - mae: 0.0230 - val_loss: 8.4974e-04 - val_mae: 0.0251\n",
            "Epoch 43/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.4331e-04 - mae: 0.0215 - val_loss: 8.5526e-04 - val_mae: 0.0264\n",
            "Epoch 44/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 6.6416e-04 - mae: 0.0221 - val_loss: 8.4034e-04 - val_mae: 0.0260\n",
            "Epoch 45/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.7864e-04 - mae: 0.0242 - val_loss: 9.1566e-04 - val_mae: 0.0250\n",
            "Epoch 46/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 6.8302e-04 - mae: 0.0207 - val_loss: 0.0011 - val_mae: 0.0290\n",
            "Epoch 47/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 8.8531e-04 - mae: 0.0255 - val_loss: 0.0012 - val_mae: 0.0261\n",
            "Epoch 48/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 0.0010 - mae: 0.0242 - val_loss: 8.5470e-04 - val_mae: 0.0264\n",
            "Epoch 49/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 8.5538e-04 - mae: 0.0235 - val_loss: 9.0461e-04 - val_mae: 0.0271\n",
            "Epoch 50/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 8.3663e-04 - mae: 0.0245 - val_loss: 0.0010 - val_mae: 0.0254\n",
            "Epoch 51/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.0976e-04 - mae: 0.0218 - val_loss: 9.6546e-04 - val_mae: 0.0277\n",
            "Epoch 52/100\n",
            "6/6 [==============================] - 0s 9ms/step - loss: 9.2072e-04 - mae: 0.0252 - val_loss: 8.7586e-04 - val_mae: 0.0267\n",
            "Epoch 53/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.7637e-04 - mae: 0.0235 - val_loss: 8.4499e-04 - val_mae: 0.0252\n",
            "Epoch 54/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 6.8052e-04 - mae: 0.0226 - val_loss: 8.4043e-04 - val_mae: 0.0253\n",
            "Epoch 55/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.3551e-04 - mae: 0.0226 - val_loss: 8.3528e-04 - val_mae: 0.0256\n",
            "Epoch 56/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 6.7654e-04 - mae: 0.0219 - val_loss: 8.8698e-04 - val_mae: 0.0269\n",
            "Epoch 57/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.3546e-04 - mae: 0.0232 - val_loss: 9.2346e-04 - val_mae: 0.0250\n",
            "Epoch 58/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 8.0102e-04 - mae: 0.0220 - val_loss: 0.0013 - val_mae: 0.0306\n",
            "Epoch 59/100\n",
            "6/6 [==============================] - 0s 9ms/step - loss: 0.0011 - mae: 0.0280 - val_loss: 8.3792e-04 - val_mae: 0.0254\n",
            "Epoch 60/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 9.1964e-04 - mae: 0.0252 - val_loss: 9.7688e-04 - val_mae: 0.0251\n",
            "Epoch 61/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 8.3015e-04 - mae: 0.0230 - val_loss: 8.5337e-04 - val_mae: 0.0263\n",
            "Epoch 62/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 8.5996e-04 - mae: 0.0243 - val_loss: 8.3637e-04 - val_mae: 0.0257\n",
            "Epoch 63/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.5642e-04 - mae: 0.0237 - val_loss: 9.3817e-04 - val_mae: 0.0250\n",
            "Epoch 64/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 8.8207e-04 - mae: 0.0244 - val_loss: 8.6595e-04 - val_mae: 0.0266\n",
            "Epoch 65/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 7.5487e-04 - mae: 0.0231 - val_loss: 8.5121e-04 - val_mae: 0.0263\n",
            "Epoch 66/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 6.9196e-04 - mae: 0.0222 - val_loss: 0.0011 - val_mae: 0.0253\n",
            "Epoch 67/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 8.5080e-04 - mae: 0.0220 - val_loss: 0.0013 - val_mae: 0.0304\n",
            "Epoch 68/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 9.3323e-04 - mae: 0.0249 - val_loss: 9.2514e-04 - val_mae: 0.0250\n",
            "Epoch 69/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 6.4373e-04 - mae: 0.0214 - val_loss: 9.2058e-04 - val_mae: 0.0273\n",
            "Epoch 70/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.4666e-04 - mae: 0.0227 - val_loss: 8.3819e-04 - val_mae: 0.0256\n",
            "Epoch 71/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.0207e-04 - mae: 0.0218 - val_loss: 9.1534e-04 - val_mae: 0.0272\n",
            "Epoch 72/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 8.1527e-04 - mae: 0.0244 - val_loss: 0.0010 - val_mae: 0.0252\n",
            "Epoch 73/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 9.5500e-04 - mae: 0.0238 - val_loss: 8.4162e-04 - val_mae: 0.0260\n",
            "Epoch 74/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.5374e-04 - mae: 0.0227 - val_loss: 8.4190e-04 - val_mae: 0.0255\n",
            "Epoch 75/100\n",
            "6/6 [==============================] - 0s 10ms/step - loss: 6.5247e-04 - mae: 0.0211 - val_loss: 8.4693e-04 - val_mae: 0.0254\n",
            "Epoch 76/100\n",
            "6/6 [==============================] - 0s 10ms/step - loss: 7.3209e-04 - mae: 0.0220 - val_loss: 9.1979e-04 - val_mae: 0.0272\n",
            "Epoch 77/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 8.1132e-04 - mae: 0.0243 - val_loss: 9.6925e-04 - val_mae: 0.0251\n",
            "Epoch 78/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.9817e-04 - mae: 0.0236 - val_loss: 9.6579e-04 - val_mae: 0.0277\n",
            "Epoch 79/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 8.7666e-04 - mae: 0.0242 - val_loss: 9.4684e-04 - val_mae: 0.0275\n",
            "Epoch 80/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.8953e-04 - mae: 0.0235 - val_loss: 9.6187e-04 - val_mae: 0.0251\n",
            "Epoch 81/100\n",
            "6/6 [==============================] - 0s 9ms/step - loss: 7.9530e-04 - mae: 0.0222 - val_loss: 9.0846e-04 - val_mae: 0.0271\n",
            "Epoch 82/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 8.5763e-04 - mae: 0.0248 - val_loss: 8.3873e-04 - val_mae: 0.0257\n",
            "Epoch 83/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 6.6067e-04 - mae: 0.0221 - val_loss: 0.0010 - val_mae: 0.0281\n",
            "Epoch 84/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 8.8731e-04 - mae: 0.0254 - val_loss: 8.9134e-04 - val_mae: 0.0251\n",
            "Epoch 85/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 8.1048e-04 - mae: 0.0233 - val_loss: 8.5842e-04 - val_mae: 0.0253\n",
            "Epoch 86/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 6.8501e-04 - mae: 0.0225 - val_loss: 8.4013e-04 - val_mae: 0.0256\n",
            "Epoch 87/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.3615e-04 - mae: 0.0218 - val_loss: 0.0012 - val_mae: 0.0295\n",
            "Epoch 88/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 0.0010 - mae: 0.0273 - val_loss: 8.5857e-04 - val_mae: 0.0253\n",
            "Epoch 89/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 8.3378e-04 - mae: 0.0241 - val_loss: 0.0010 - val_mae: 0.0251\n",
            "Epoch 90/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 0.0010 - mae: 0.0247 - val_loss: 8.7960e-04 - val_mae: 0.0268\n",
            "Epoch 91/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.5908e-04 - mae: 0.0228 - val_loss: 8.4580e-04 - val_mae: 0.0255\n",
            "Epoch 92/100\n",
            "6/6 [==============================] - 0s 13ms/step - loss: 6.4425e-04 - mae: 0.0220 - val_loss: 8.4094e-04 - val_mae: 0.0259\n",
            "Epoch 93/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.8918e-04 - mae: 0.0237 - val_loss: 0.0010 - val_mae: 0.0251\n",
            "Epoch 94/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 8.5163e-04 - mae: 0.0235 - val_loss: 8.7668e-04 - val_mae: 0.0267\n",
            "Epoch 95/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.2157e-04 - mae: 0.0218 - val_loss: 8.6276e-04 - val_mae: 0.0265\n",
            "Epoch 96/100\n",
            "6/6 [==============================] - 0s 7ms/step - loss: 7.7666e-04 - mae: 0.0237 - val_loss: 9.2775e-04 - val_mae: 0.0251\n",
            "Epoch 97/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.9270e-04 - mae: 0.0228 - val_loss: 8.6700e-04 - val_mae: 0.0266\n",
            "Epoch 98/100\n",
            "6/6 [==============================] - 0s 6ms/step - loss: 7.2839e-04 - mae: 0.0229 - val_loss: 8.3969e-04 - val_mae: 0.0257\n",
            "Epoch 99/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 7.2456e-04 - mae: 0.0230 - val_loss: 8.8624e-04 - val_mae: 0.0252\n",
            "Epoch 100/100\n",
            "6/6 [==============================] - 0s 8ms/step - loss: 7.3666e-04 - mae: 0.0223 - val_loss: 9.1588e-04 - val_mae: 0.0272\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 542
        },
        "id": "m40rR1lA8COE",
        "outputId": "865a83fe-c2fd-4cc0-fa6e-553f23e1fca6"
      },
      "source": [
        "fig = go.Figure()\n",
        "\n",
        "fig.add_trace(go.Scatter(x=np.arange(0, epochs, 1),\n",
        "                         y=history.history['mae'],\n",
        "                         mode='lines',\n",
        "                         name=f'Training MAE',\n",
        "                         marker_size=3, \n",
        "                         line_color='orange'))\n",
        "fig.add_trace(go.Scatter(x=np.arange(0, epochs, 1),\n",
        "                         y=history.history['val_mae'],\n",
        "                         mode='lines',\n",
        "                         name=f'Validation MAE',\n",
        "                         line_color='grey'))\n",
        "\n",
        "fig.update_layout(\n",
        "                  title=\"Network training\",\n",
        "                  xaxis_title=\"Epochs\",\n",
        "                  yaxis_title=f\"Mean Absolute Error\")\n",
        "fig.update_layout({'plot_bgcolor': '#f2f8fd' , \n",
        "                   'paper_bgcolor': 'white',}, \n",
        "                   template='plotly_white')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<html>\n",
              "<head><meta charset=\"utf-8\" /></head>\n",
              "<body>\n",
              "    <div>\n",
              "            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>\n",
              "                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
              "        <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>    \n",
              "            <div id=\"efacddb7-6d56-484e-afaa-a367672c1f27\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>\n",
              "            <script type=\"text/javascript\">\n",
              "                \n",
              "                    window.PLOTLYENV=window.PLOTLYENV || {};\n",
              "                    \n",
              "                if (document.getElementById(\"efacddb7-6d56-484e-afaa-a367672c1f27\")) {\n",
              "                    Plotly.newPlot(\n",
              "                        'efacddb7-6d56-484e-afaa-a367672c1f27',\n",
              "                        [{\"line\": {\"color\": \"orange\"}, \"marker\": {\"size\": 3}, \"mode\": \"lines\", \"name\": \"Training MAE\", \"type\": \"scatter\", \"x\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99], \"y\": [0.06433720141649246, 0.039855439215898514, 0.03453828766942024, 0.030640751123428345, 0.02801935188472271, 0.02372824214398861, 0.025502970442175865, 0.023659629747271538, 0.02271365560591221, 0.024111570790410042, 0.023083144798874855, 0.02317742630839348, 0.025854313746094704, 0.023383278399705887, 0.024281593039631844, 0.022763384506106377, 0.023362893611192703, 0.02254028245806694, 0.023293916136026382, 0.022409992292523384, 0.024142593145370483, 0.022419888526201248, 0.024723390117287636, 0.02236810326576233, 0.023487908765673637, 0.02201301045715809, 0.023585651069879532, 0.022844022139906883, 0.0228434931486845, 0.02292601577937603, 0.021803660318255424, 0.02457791566848755, 0.02267615497112274, 0.023824164643883705, 0.024615049362182617, 0.021575475111603737, 0.02420538105070591, 0.022297898307442665, 0.024299534037709236, 0.023770762607455254, 0.026130186393857002, 0.024429114535450935, 0.022431185469031334, 0.02229173295199871, 0.02348780632019043, 0.022293295711278915, 0.024506106972694397, 0.024164101108908653, 0.02309267781674862, 0.024582693353295326, 0.02324698679149151, 0.0246844831854105, 0.025231560692191124, 0.02358066849410534, 0.02228471077978611, 0.02233411930501461, 0.02368600107729435, 0.023055752739310265, 0.027168478816747665, 0.02559399977326393, 0.023675939068198204, 0.022698281332850456, 0.02302948571741581, 0.022577153518795967, 0.02251344546675682, 0.024113425984978676, 0.02353671006858349, 0.02348547801375389, 0.022628528997302055, 0.022436799481511116, 0.022551562637090683, 0.023335184901952744, 0.023060347884893417, 0.022131403908133507, 0.022775011137127876, 0.02217399887740612, 0.023707479238510132, 0.0230683833360672, 0.02375912293791771, 0.023701855912804604, 0.021960631012916565, 0.022745536640286446, 0.022428633645176888, 0.023884816095232964, 0.02339486964046955, 0.02289409749209881, 0.02281508408486843, 0.025024056434631348, 0.02326173707842827, 0.02381839230656624, 0.022384272888302803, 0.02255699597299099, 0.022742075845599174, 0.024824371561408043, 0.02234150469303131, 0.023338984698057175, 0.022348403930664062, 0.022524181753396988, 0.02310316450893879, 0.022018913179636]}, {\"line\": {\"color\": \"grey\"}, \"mode\": \"lines\", \"name\": \"Validation MAE\", \"type\": \"scatter\", \"x\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99], \"y\": [0.04407010227441788, 0.04778331518173218, 0.03544997423887253, 0.028946274891495705, 0.025766458362340927, 0.025467151775956154, 0.027034863829612732, 0.025361264124512672, 0.026648521423339844, 0.02544093132019043, 0.025803489610552788, 0.026022450998425484, 0.025254514068365097, 0.02551676519215107, 0.0253116637468338, 0.025720974430441856, 0.02570485509932041, 0.025350654497742653, 0.025302350521087646, 0.026357706636190414, 0.025034397840499878, 0.027788996696472168, 0.025249777361750603, 0.02766217663884163, 0.024959085509181023, 0.027529120445251465, 0.0249489676207304, 0.026166845113039017, 0.025548329576849937, 0.024935593828558922, 0.026992157101631165, 0.025388674810528755, 0.028768759220838547, 0.025825755670666695, 0.02710329368710518, 0.02497636340558529, 0.025041626766324043, 0.02705814130604267, 0.028704656288027763, 0.03034454770386219, 0.024920767173171043, 0.025073464959859848, 0.026366055011749268, 0.02598107047379017, 0.02498566173017025, 0.029018985107541084, 0.02610713616013527, 0.02636699564754963, 0.027080347761511803, 0.025359438732266426, 0.02773171477019787, 0.02672700770199299, 0.025218738242983818, 0.025315353646874428, 0.025623539462685585, 0.026880118995904922, 0.02500908635556698, 0.030602559447288513, 0.025438429787755013, 0.025097565725445747, 0.02633661963045597, 0.025650572031736374, 0.025037599727511406, 0.026572763919830322, 0.02627686969935894, 0.025311008095741272, 0.0304021667689085, 0.02502148039638996, 0.02725851908326149, 0.025595897808670998, 0.027204934507608414, 0.025184540078043938, 0.025963863357901573, 0.02546553872525692, 0.025378018617630005, 0.027249803766608238, 0.025091037154197693, 0.027673471719026566, 0.02750418148934841, 0.025079499930143356, 0.027130499482154846, 0.025659099221229553, 0.02809354104101658, 0.025142544880509377, 0.02528093196451664, 0.025583995506167412, 0.029493775218725204, 0.025297189131379128, 0.025140192359685898, 0.026766201481223106, 0.025453627109527588, 0.025881106033921242, 0.02514949068427086, 0.02672426402568817, 0.026488738134503365, 0.025065967813134193, 0.026566753163933754, 0.02572333812713623, 0.02518348954617977, 0.027206210419535637]}],\n",
              "                        {\"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"#f2f8fd\", \"template\": {\"data\": {\"bar\": [{\"error_x\": {\"color\": \"#2a3f5f\"}, \"error_y\": {\"color\": \"#2a3f5f\"}, \"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"bar\"}], \"barpolar\": [{\"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"baxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"choropleth\"}], \"contour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"contour\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"contourcarpet\"}], \"heatmap\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmap\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmapgl\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"histogram\"}], \"histogram2d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2d\"}], \"histogram2dcontour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2dcontour\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"parcoords\"}], \"pie\": [{\"automargin\": true, \"type\": \"pie\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter\"}], \"scatter3d\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattermapbox\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolar\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolargl\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"#EBF0F8\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"#C8D4E3\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowcolor\": \"#2a3f5f\", \"arrowhead\": 0, \"arrowwidth\": 1}, \"coloraxis\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"colorscale\": {\"diverging\": [[0, \"#8e0152\"], [0.1, \"#c51b7d\"], [0.2, \"#de77ae\"], [0.3, \"#f1b6da\"], [0.4, \"#fde0ef\"], [0.5, \"#f7f7f7\"], [0.6, \"#e6f5d0\"], [0.7, \"#b8e186\"], [0.8, \"#7fbc41\"], [0.9, \"#4d9221\"], [1, \"#276419\"]], \"sequential\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"sequentialminus\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]]}, \"colorway\": [\"#636efa\", \"#EF553B\", \"#00cc96\", \"#ab63fa\", \"#FFA15A\", \"#19d3f3\", \"#FF6692\", \"#B6E880\", \"#FF97FF\", \"#FECB52\"], \"font\": {\"color\": \"#2a3f5f\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"white\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"#C8D4E3\"}, \"hoverlabel\": {\"align\": \"left\"}, \"hovermode\": \"closest\", \"mapbox\": {\"style\": \"light\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"white\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"radialaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"yaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"zaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}}, \"shapedefaults\": {\"line\": {\"color\": \"#2a3f5f\"}}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"baxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"caxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}}, \"title\": {\"x\": 0.05}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}}}, \"title\": {\"text\": \"Network training\"}, \"xaxis\": {\"title\": {\"text\": \"Epochs\"}}, \"yaxis\": {\"title\": {\"text\": \"Mean Absolute Error\"}}},\n",
              "                        {\"responsive\": true}\n",
              "                    ).then(function(){\n",
              "                            \n",
              "var gd = document.getElementById('efacddb7-6d56-484e-afaa-a367672c1f27');\n",
              "var x = new MutationObserver(function (mutations, observer) {{\n",
              "        var display = window.getComputedStyle(gd).display;\n",
              "        if (!display || display === 'none') {{\n",
              "            console.log([gd, 'removed!']);\n",
              "            Plotly.purge(gd);\n",
              "            observer.disconnect();\n",
              "        }}\n",
              "}});\n",
              "\n",
              "// Listen for the removal of the full notebook cells\n",
              "var notebookContainer = gd.closest('#notebook-container');\n",
              "if (notebookContainer) {{\n",
              "    x.observe(notebookContainer, {childList: true});\n",
              "}}\n",
              "\n",
              "// Listen for the clearing of the current output cell\n",
              "var outputEl = gd.closest('.output');\n",
              "if (outputEl) {{\n",
              "    x.observe(outputEl, {childList: true});\n",
              "}}\n",
              "\n",
              "                        })\n",
              "                };\n",
              "                \n",
              "            </script>\n",
              "        </div>\n",
              "</body>\n",
              "</html>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "gXIxRV1HS2S3"
      },
      "source": [
        "### 4. Compile the hybrid digital twin"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 542
        },
        "id": "0PjNqTBjAEEi",
        "outputId": "ff5267eb-f824-4909-a738-18f3c83b375a"
      },
      "source": [
        "fig = go.Figure()\n",
        "fig.add_trace(go.Scatter(x=X_in_train, \n",
        "                         y=X_out_train,\n",
        "                         mode='markers',\n",
        "                         name=f'Modelled Capacity',\n",
        "                         marker=dict(\n",
        "                              size=4,\n",
        "                              color='grey',\n",
        "                              symbol='cross'\n",
        "                                 ), \n",
        "                        line_color='crimson'))\n",
        "fig.add_trace(go.Scatter(x = X_in_train, \n",
        "                         y=model.predict(X_in_train).reshape(-1),\n",
        "                         mode='lines',\n",
        "                         name=f'Trained Capacity',\n",
        "                         line=dict(color='navy', width=3)))\n",
        "fig.update_layout(\n",
        "    title=\"Network training\",\n",
        "    xaxis_title=\"Modelled capacity\",\n",
        "    yaxis_title=\"Δ (Mod. Capacity - Measured Cap.)\")\n",
        "\n",
        "fig.update_layout(legend=dict(\n",
        "    yanchor=\"top\",\n",
        "    y=0.95,\n",
        "    xanchor=\"left\",\n",
        "    x=0.45\n",
        "))\n",
        "fig.update_layout({'plot_bgcolor': '#f2f8fd' , #or azure\n",
        "'paper_bgcolor': 'white',}, template='plotly_white')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<html>\n",
              "<head><meta charset=\"utf-8\" /></head>\n",
              "<body>\n",
              "    <div>\n",
              "            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>\n",
              "                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
              "        <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>    \n",
              "            <div id=\"47137558-1353-4ea2-bb0d-2caa6f481e56\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>\n",
              "            <script type=\"text/javascript\">\n",
              "                \n",
              "                    window.PLOTLYENV=window.PLOTLYENV || {};\n",
              "                    \n",
              "                if (document.getElementById(\"47137558-1353-4ea2-bb0d-2caa6f481e56\")) {\n",
              "                    Plotly.newPlot(\n",
              "                        '47137558-1353-4ea2-bb0d-2caa6f481e56',\n",
              "                        [{\"line\": {\"color\": \"crimson\"}, \"marker\": {\"color\": \"grey\", \"size\": 4, \"symbol\": \"cross\"}, \"mode\": \"markers\", \"name\": \"Modelled Capacity\", \"type\": \"scatter\", \"x\": [1.8059154298004312, 1.6169663604275857, 1.831267470067291, 1.3576118429666406, 1.4103765774337609, 1.6100932526321914, 1.4360401050273368, 1.59528055220688, 1.3139239578940467, 1.4013341823343977, 1.7604664378279238, 1.5395054950721865, 1.6499092083522247, 1.305550901999312, 1.7794658471810845, 1.645914111885159, 1.3816997290230144, 1.5604799643853628, 1.7002289346717998, 1.8396524255157125, 1.464267380722019, 1.505702328364038, 1.5438138452833383, 1.842473478835287, 1.7086145559214938, 1.3641820993725786, 1.2885111714900441, 1.6763082874834179, 1.3514619258484795, 1.7161029296467465, 1.6797788509402931, 1.530776487688899, 1.2808262054065005, 1.7444164793300367, 1.3939702258137434, 1.660698932143747, 1.828503784093851, 1.850850402729868, 1.5842185401928082, 1.2839692698581224, 1.3668108144066167, 1.6265075909161366, 1.5352168877525205, 1.727086473691884, 1.2768250879383842, 1.4143528051397996, 1.7539143054193773, 1.7736143377224274, 1.787809156394655, 1.548713568685512, 1.273038936061159, 1.2720399623004237, 1.6657666270521303, 1.7982301806489422, 1.75082215499336, 1.487536219041169, 1.7565710589137493, 1.8016482343497668, 1.7398752500218797, 1.521877766243235, 1.5870486815167304, 1.7906082695539571, 1.8227393050077814, 1.5015089909991184, 1.3618378449094168, 1.405137486611523, 1.482084487511379, 1.3420425677315664, 1.6346026896147958, 1.776594140463695, 1.7851032906279236, 1.3275722777315915, 1.7720343040962534, 1.6016314523984518, 1.4395359688144573, 1.566406644872898, 1.3786204372635644, 1.4483095477557382, 1.3476841165148965, 1.4223693732558793, 1.3718504490530294, 1.8368269464109566, 1.825742611735947, 1.4963431778687801, 1.7114386688325567, 1.575222345473598, 1.5176745072050215, 1.686862146400443, 1.8199149036559383, 1.6977559338646548, 1.4449334534024794, 1.7303377784047618, 1.3862182336675275, 1.7327255958357504, 1.5263216773823127, 1.3324149085603154, 1.2970055930259634, 1.7232150912459092, 1.6537832663404595, 1.66831671020391, 1.6380513854243808, 1.7481720933513072, 1.5118595340890693, 1.8340507209620598, 1.4608702741491437, 1.590794383858618, 1.5700561908643627, 1.715435290101237, 1.8452416845039394, 1.331147411045945, 1.442305974540704, 1.3930954905793484], \"y\": [-0.002847115517021548, -0.032023289690173984, -0.006493617078157765, -0.018620463897065065, -0.03514016240813844, -0.0353630778520877, -0.02905844134969393, -0.035798985388456606, 0.004709938859246199, -0.030825625707357585, 0.044143466752596394, -0.032941599004076005, -0.012051365329854846, 0.007651161444908405, 0.03450354152926738, -0.013179071175248191, -0.01691693409693862, -0.012388439608584267, 0.03619357097601883, -0.003990765448163236, -0.03620250727425889, -0.02490173367113968, -0.03191624926906922, -0.007827970623245362, 0.038256062062296925, -0.014867101869120658, 0.014898872375520122, 0.008594621177510753, -0.012547402827782328, 0.0775210852106143, 0.014801009239496565, -0.039932082648875156, 0.017247300285389677, 0.028621275748900166, -0.018578208917981343, -0.0016850633955012295, -0.0038905155969148897, -0.0045231530099412165, -0.045981941250250014, 0.01391781079144816, -0.01210689308737578, -0.024993367524377197, -0.03367153508538423, 0.014763131104116756, 0.016638525905858792, -0.033916128942385715, 0.03452892811766883, 0.030462702394924435, 0.03777234782572103, -0.03175626697187939, 0.03597642816957647, 0.015963430318694183, -0.0020502510707252064, 0.049187130634701814, 0.03210089343191247, -0.032512467134485856, 0.042806006283469866, 0.04537776058315268, 0.027996860644325716, -0.04146408826712911, -0.038174573527688604, 0.03450537395387965, -0.008537369240389392, -0.031754664152435996, -0.01764865111236147, -0.03462468412202213, -0.033042323750143154, -0.018871668503944283, -0.023277029238210956, 0.026171524704128313, 0.028927836880467295, 0.011958409063143938, 0.07976824757419543, -0.04186550506141562, -0.022181251365904764, -0.0025575001984554646, -0.024298390637568, -0.014917499233590537, -0.01367744053873099, -0.031084584403153315, -0.017208747215133213, -0.0016808034882962453, -0.0011230590494966108, -0.0424419503841873, 0.0455791162027499, -0.04669708249795357, -0.04246492030185833, 0.019152353248077958, -0.006162745901033606, 0.028565790058927787, -0.006678435723188603, 0.02139270866165255, -0.016368230083633417, 0.029942763907396586, -0.04045329282111165, -0.00854248631604726, 0.006027325614628376, 0.01287625993880459, -0.011129484210328666, 0.006252537784000145, -0.015925899903221685, 0.024861622450521592, -0.01576770427539964, -0.008293930395506521, -0.03794995597502515, -0.03610503026800793, -0.04740886557998447, 0.0677537322260906, -0.009979156921826604, -0.01268096738191149, -0.03470760139371443, -0.006983975425809197]}, {\"line\": {\"color\": \"navy\", \"width\": 3}, \"mode\": \"lines\", \"name\": \"Trained Capacity\", \"type\": \"scatter\", \"x\": [1.8059154298004312, 1.6169663604275857, 1.831267470067291, 1.3576118429666406, 1.4103765774337609, 1.6100932526321914, 1.4360401050273368, 1.59528055220688, 1.3139239578940467, 1.4013341823343977, 1.7604664378279238, 1.5395054950721865, 1.6499092083522247, 1.305550901999312, 1.7794658471810845, 1.645914111885159, 1.3816997290230144, 1.5604799643853628, 1.7002289346717998, 1.8396524255157125, 1.464267380722019, 1.505702328364038, 1.5438138452833383, 1.842473478835287, 1.7086145559214938, 1.3641820993725786, 1.2885111714900441, 1.6763082874834179, 1.3514619258484795, 1.7161029296467465, 1.6797788509402931, 1.530776487688899, 1.2808262054065005, 1.7444164793300367, 1.3939702258137434, 1.660698932143747, 1.828503784093851, 1.850850402729868, 1.5842185401928082, 1.2839692698581224, 1.3668108144066167, 1.6265075909161366, 1.5352168877525205, 1.727086473691884, 1.2768250879383842, 1.4143528051397996, 1.7539143054193773, 1.7736143377224274, 1.787809156394655, 1.548713568685512, 1.273038936061159, 1.2720399623004237, 1.6657666270521303, 1.7982301806489422, 1.75082215499336, 1.487536219041169, 1.7565710589137493, 1.8016482343497668, 1.7398752500218797, 1.521877766243235, 1.5870486815167304, 1.7906082695539571, 1.8227393050077814, 1.5015089909991184, 1.3618378449094168, 1.405137486611523, 1.482084487511379, 1.3420425677315664, 1.6346026896147958, 1.776594140463695, 1.7851032906279236, 1.3275722777315915, 1.7720343040962534, 1.6016314523984518, 1.4395359688144573, 1.566406644872898, 1.3786204372635644, 1.4483095477557382, 1.3476841165148965, 1.4223693732558793, 1.3718504490530294, 1.8368269464109566, 1.825742611735947, 1.4963431778687801, 1.7114386688325567, 1.575222345473598, 1.5176745072050215, 1.686862146400443, 1.8199149036559383, 1.6977559338646548, 1.4449334534024794, 1.7303377784047618, 1.3862182336675275, 1.7327255958357504, 1.5263216773823127, 1.3324149085603154, 1.2970055930259634, 1.7232150912459092, 1.6537832663404595, 1.66831671020391, 1.6380513854243808, 1.7481720933513072, 1.5118595340890693, 1.8340507209620598, 1.4608702741491437, 1.590794383858618, 1.5700561908643627, 1.715435290101237, 1.8452416845039394, 1.331147411045945, 1.442305974540704, 1.3930954905793484], \"y\": [0.020778249949216843, 0.007646676152944565, 0.02254016324877739, -0.010374080389738083, -0.006709326058626175, 0.007169034332036972, -0.004926759749650955, 0.006139565259218216, -0.013408444821834564, -0.00733734667301178, 0.017619643360376358, 0.002263326197862625, 0.009936142712831497, -0.013989996165037155, 0.018940094858407974, 0.009658508002758026, -0.008701048791408539, 0.00372101366519928, 0.0134333036839962, 0.02312290295958519, -0.002965569496154785, -8.590146899223328e-05, 0.002562757581472397, 0.02331892028450966, 0.014016035944223404, -0.009917739778757095, -0.015173487365245819, 0.011770803481340408, -0.010801225900650024, 0.014536451548337936, 0.012012038379907608, 0.0016566924750804901, -0.015707239508628845, 0.016504202038049698, -0.007848810404539108, 0.010685991495847702, 0.022348064929246902, 0.023901131004095078, 0.005370769649744034, -0.015488948673009872, -0.009735140949487686, 0.008309777826070786, 0.0019652992486953735, 0.015299823135137558, -0.015985149890184402, -0.006433136761188507, 0.01716432347893715, 0.01853339746594429, 0.019519861787557602, 0.002903267741203308, -0.016248099505901337, -0.016317494213581085, 0.011038165539503098, 0.020244088023900986, 0.01694938912987709, -0.0013484396040439606, 0.017348963767290115, 0.020481709390878677, 0.016188617795705795, 0.0010382682085037231, 0.005567431449890137, 0.019714411348104477, 0.02194751426577568, -0.0003773905336856842, -0.010080564767122269, -0.00707317516207695, -0.0017273537814617157, -0.01145545020699501, 0.008872371166944504, 0.018740501254796982, 0.01933186873793602, -0.012460514903068542, 0.01842356100678444, 0.006580930203199387, -0.004683993756771088, 0.004132881760597229, -0.00891491025686264, -0.004074607044458389, -0.011063627898693085, -0.005876332521438599, -0.009385142475366592, 0.02292652800679207, 0.02215617522597313, -0.000736381858587265, 0.014212336391210556, 0.004745557904243469, 0.000746116042137146, 0.012504298239946365, 0.021751169115304947, 0.013261403888463974, -0.004309166222810745, 0.0155256949365139, -0.00838720053434372, 0.01569167897105217, 0.0013470686972141266, -0.012124143540859222, -0.01458350196480751, 0.01503070816397667, 0.010205414146184921, 0.011215437203645706, 0.009112048894166946, 0.016765233129262924, 0.0003419630229473114, 0.022733595222234726, -0.0032016821205615997, 0.005827769637107849, 0.004386503249406815, 0.014490034431219101, 0.02351132407784462, -0.012212157249450684, -0.004491627216339111, -0.007909547537565231]}],\n",
              "                        {\"legend\": {\"x\": 0.45, \"xanchor\": \"left\", \"y\": 0.95, \"yanchor\": \"top\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"#f2f8fd\", \"template\": {\"data\": {\"bar\": [{\"error_x\": {\"color\": \"#2a3f5f\"}, \"error_y\": {\"color\": \"#2a3f5f\"}, \"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"bar\"}], \"barpolar\": [{\"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"baxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"choropleth\"}], \"contour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"contour\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"contourcarpet\"}], \"heatmap\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmap\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmapgl\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"histogram\"}], \"histogram2d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2d\"}], \"histogram2dcontour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2dcontour\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"parcoords\"}], \"pie\": [{\"automargin\": true, \"type\": \"pie\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter\"}], \"scatter3d\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattermapbox\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolar\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolargl\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"#EBF0F8\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"#C8D4E3\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowcolor\": \"#2a3f5f\", \"arrowhead\": 0, \"arrowwidth\": 1}, \"coloraxis\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"colorscale\": {\"diverging\": [[0, \"#8e0152\"], [0.1, \"#c51b7d\"], [0.2, \"#de77ae\"], [0.3, \"#f1b6da\"], [0.4, \"#fde0ef\"], [0.5, \"#f7f7f7\"], [0.6, \"#e6f5d0\"], [0.7, \"#b8e186\"], [0.8, \"#7fbc41\"], [0.9, \"#4d9221\"], [1, \"#276419\"]], \"sequential\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"sequentialminus\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]]}, \"colorway\": [\"#636efa\", \"#EF553B\", \"#00cc96\", \"#ab63fa\", \"#FFA15A\", \"#19d3f3\", \"#FF6692\", \"#B6E880\", \"#FF97FF\", \"#FECB52\"], \"font\": {\"color\": \"#2a3f5f\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"white\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"#C8D4E3\"}, \"hoverlabel\": {\"align\": \"left\"}, \"hovermode\": \"closest\", \"mapbox\": {\"style\": \"light\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"white\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"radialaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"yaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"zaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}}, \"shapedefaults\": {\"line\": {\"color\": \"#2a3f5f\"}}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"baxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"caxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}}, \"title\": {\"x\": 0.05}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}}}, \"title\": {\"text\": \"Network training\"}, \"xaxis\": {\"title\": {\"text\": \"Modelled capacity\"}}, \"yaxis\": {\"title\": {\"text\": \"\\u0394 (Mod. Capacity - Measured Cap.)\"}}},\n",
              "                        {\"responsive\": true}\n",
              "                    ).then(function(){\n",
              "                            \n",
              "var gd = document.getElementById('47137558-1353-4ea2-bb0d-2caa6f481e56');\n",
              "var x = new MutationObserver(function (mutations, observer) {{\n",
              "        var display = window.getComputedStyle(gd).display;\n",
              "        if (!display || display === 'none') {{\n",
              "            console.log([gd, 'removed!']);\n",
              "            Plotly.purge(gd);\n",
              "            observer.disconnect();\n",
              "        }}\n",
              "}});\n",
              "\n",
              "// Listen for the removal of the full notebook cells\n",
              "var notebookContainer = gd.closest('#notebook-container');\n",
              "if (notebookContainer) {{\n",
              "    x.observe(notebookContainer, {childList: true});\n",
              "}}\n",
              "\n",
              "// Listen for the clearing of the current output cell\n",
              "var outputEl = gd.closest('.output');\n",
              "if (outputEl) {{\n",
              "    x.observe(outputEl, {childList: true});\n",
              "}}\n",
              "\n",
              "                        })\n",
              "                };\n",
              "                \n",
              "            </script>\n",
              "        </div>\n",
              "</body>\n",
              "</html>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 542
        },
        "id": "5U6sfANYBjxd",
        "outputId": "52c95c9b-d4b2-4103-fe3b-85fcce2f607c"
      },
      "source": [
        "X_twin = X_in + model.predict(X_in).reshape(-1)\n",
        "\n",
        "fig = go.Figure()\n",
        "\n",
        "fig.add_trace(go.Scatter(x=dfb.index, \n",
        "                         y=X_twin,\n",
        "                         mode='lines',\n",
        "                         name=f'Hybrid digial twin',\n",
        "                         line=dict(color='firebrick', width=3)))\n",
        "fig.add_trace(go.Scatter(x=dfb.index, \n",
        "                         y=dfb['C. Capacity'],\n",
        "                         mode='lines',\n",
        "                         name=f'Modelled capacity',\n",
        "                         line=dict(color='navy', \n",
        "                                   width=3,\n",
        "                                   dash='dash')))\n",
        "\n",
        "fig.add_trace(go.Scatter(x=dfb.index, \n",
        "                         y=dfb['Capacity'],\n",
        "                         mode='markers',\n",
        "                         marker=dict(\n",
        "                              size=4,\n",
        "                              color='grey',\n",
        "                              symbol='cross'\n",
        "                                 ),\n",
        "                         name=f'Observed capacity',\n",
        "                         line_color='navy'))\n",
        "fig.update_layout(\n",
        "    title=\"Comparison of hybrid twin with other models\",\n",
        "    xaxis_title=\"Cycles\",\n",
        "    yaxis_title=\"Capacity in Ahr\")\n",
        "fig.update_layout(legend=dict(\n",
        "    yanchor=\"top\",\n",
        "    y=0.95,\n",
        "    xanchor=\"left\",\n",
        "    x=0.77\n",
        "))\n",
        "fig.update_layout({'plot_bgcolor': '#f2f8fd',\n",
        "                  'paper_bgcolor': 'white',}, \n",
        "                   template='plotly_white')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<html>\n",
              "<head><meta charset=\"utf-8\" /></head>\n",
              "<body>\n",
              "    <div>\n",
              "            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>\n",
              "                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
              "        <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>    \n",
              "            <div id=\"24b18cb1-6e78-447b-bf60-418ccae79438\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>\n",
              "            <script type=\"text/javascript\">\n",
              "                \n",
              "                    window.PLOTLYENV=window.PLOTLYENV || {};\n",
              "                    \n",
              "                if (document.getElementById(\"24b18cb1-6e78-447b-bf60-418ccae79438\")) {\n",
              "                    Plotly.newPlot(\n",
              "                        '24b18cb1-6e78-447b-bf60-418ccae79438',\n",
              "                        [{\"line\": {\"color\": \"firebrick\", \"width\": 3}, \"mode\": \"lines\", \"name\": \"Hybrid digial twin\", \"type\": \"scatter\", \"x\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168], \"y\": [1.8777822929687313, 1.874751533733963, 1.871735603617768, 1.868753008581784, 1.8657923991197967, 1.8627753284752977, 1.8597534744177486, 1.8567843161842945, 1.8538076333160685, 1.8508518490230979, 1.8478987869619201, 1.8446868043723958, 1.8416660727712433, 1.8387597995257368, 1.8358409647632434, 1.8329063463696444, 1.8298295245622949, 1.826693679749648, 1.8236583796855315, 1.8221299437406455, 1.8184742686728432, 1.8159216381980108, 1.813184013676912, 1.8103226809020616, 1.8073290181822126, 1.8044351593658596, 1.8014470734212458, 1.7984059420394924, 1.7953346417184919, 1.7921477351883717, 1.790457880004199, 1.7866278651471135, 1.7836419788133777, 1.7811711734251117, 1.7780860811883001, 1.7739200226810394, 1.7710786288983145, 1.7677715441232371, 1.7649373264805701, 1.7609206813680864, 1.7560638678175855, 1.7525187597678267, 1.751282065450247, 1.7484172748068025, 1.7458634733412757, 1.7423862968270216, 1.7382457994098859, 1.7306393811950844, 1.7299253245324562, 1.728187193657829, 1.7256510052237672, 1.7226305918657172, 1.7184622938807392, 1.713662238355796, 1.7110173377531188, 1.7069583285923233, 1.7041063153345144, 1.6993664446403893, 1.6950278562364027, 1.6917908446167171, 1.6880790909647583, 1.6847035641974246, 1.679532125055814, 1.676804837295117, 1.6713849236395948, 1.6675141753296487, 1.6639886804866444, 1.6598453510650562, 1.655572619887917, 1.6514412268783105, 1.6471634343185477, 1.6434750607817403, 1.6389787863342105, 1.6348173687422074, 1.6310443233469445, 1.6268419145003727, 1.6246130365805302, 1.620800678525971, 1.6172622869642284, 1.6135020925664851, 1.6082123826016512, 1.6014201174660982, 1.596622153495726, 1.5926161129666205, 1.5895893098425522, 1.5859696222746402, 1.5799679033778415, 1.5744426941137695, 1.56981023185744, 1.5837425574035346, 1.5705395266334952, 1.5642009780505621, 1.5601179362445041, 1.5559476460326223, 1.5516168252508444, 1.5463765879636495, 1.541768821270049, 1.537182187001216, 1.5324331652628183, 1.5276687386289463, 1.5229160344517387, 1.5184206232471587, 1.5166001585063054, 1.5122014971120166, 1.5056164268950458, 1.501131593014852, 1.4956067960101929, 1.4921537164800194, 1.486187779437125, 1.4803571337299173, 1.4774614542901663, 1.4734973335720616, 1.4673542324106772, 1.4613018112258642, 1.4576685920285821, 1.4541752429260457, 1.450507770030224, 1.4445086625059405, 1.437814347324365, 1.4442349407112798, 1.4406242871796686, 1.4348519750576862, 1.4311133452776859, 1.4260636334752426, 1.4211472140446044, 1.4164930407344407, 1.4119043125181816, 1.407919679554482, 1.4036672513751347, 1.398064311449446, 1.3939968356613859, 1.3896788082392286, 1.3861214154092043, 1.3851859430417832, 1.3778310331331838, 1.3729986802316059, 1.3697055270067018, 1.3624653065776628, 1.357075673457129, 1.3542643595938215, 1.3517572801422946, 1.3472377625769025, 1.3406606999478294, 1.3366204886162034, 1.3333944182723303, 1.3305871175245714, 1.3261733333787955, 1.3189352537964942, 1.3159453300986743, 1.3202907575688756, 1.3254756671850179, 1.315111762828523, 1.3100387902197121, 1.3053623858413257, 1.3005155130722121, 1.2955784873404896, 1.2915609058342747, 1.2871409537439713, 1.282422079885285, 1.2778977734196142, 1.2733376841247983, 1.2684803211851126, 1.2651189658978717, 1.2608399380481998, 1.2557224680868426, 1.2513439054044098, 1.2567908440058382, 1.260639688055277]}, {\"line\": {\"color\": \"navy\", \"dash\": \"dash\", \"width\": 3}, \"mode\": \"lines\", \"name\": \"Modelled capacity\", \"type\": \"scatter\", \"x\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168], \"y\": [1.8536842133171372, 1.850850402729868, 1.8480304675868555, 1.8452416845039394, 1.842473478835287, 1.8396524255157125, 1.8368269464109566, 1.8340507209620598, 1.831267470067291, 1.828503784093851, 1.825742611735947, 1.8227393050077814, 1.8199149036559383, 1.817197480276822, 1.8144683298457458, 1.8117243494578803, 1.8088474788820104, 1.8059154298004312, 1.803077368956457, 1.8016482343497668, 1.7982301806489422, 1.795843333042972, 1.793283620935947, 1.7906082695539571, 1.787809156394655, 1.7851032906279236, 1.7823094115171492, 1.7794658471810845, 1.776594140463695, 1.7736143377224274, 1.7720343040962534, 1.7684531684334275, 1.7656613026690162, 1.763351072193775, 1.7604664378279238, 1.7565710589137493, 1.7539143054193773, 1.75082215499336, 1.7481720933513072, 1.7444164793300367, 1.7398752500218797, 1.7365605809794031, 1.7354041890194971, 1.7327255958357504, 1.7303377784047618, 1.727086473691884, 1.7232150912459092, 1.7161029296467465, 1.715435290101237, 1.7138100876767175, 1.7114386688325567, 1.7086145559214938, 1.7047170939917946, 1.7002289346717998, 1.6977559338646548, 1.6939607497627964, 1.691294032444433, 1.686862146400443, 1.6828054656145022, 1.6797788509402931, 1.6763082874834179, 1.673152061105374, 1.66831671020391, 1.6657666270521303, 1.660698932143747, 1.6570796930830114, 1.6537832663404595, 1.6499092083522247, 1.645914111885159, 1.6420511744703306, 1.6380513854243808, 1.6346026896147958, 1.630398623212987, 1.6265075909161366, 1.6229797068754155, 1.6190503953353337, 1.6169663604275857, 1.6134017267272935, 1.6100932526321914, 1.6065773925745437, 1.6016314523984518, 1.59528055220688, 1.590794383858618, 1.5870486815167304, 1.5842185401928082, 1.580834067454341, 1.575222345473598, 1.5700561908643627, 1.565724769317052, 1.5787517003090084, 1.566406644872898, 1.5604799643853628, 1.5566622675566837, 1.5527629400599507, 1.548713568685512, 1.5438138452833383, 1.5395054950721865, 1.5352168877525205, 1.530776487688899, 1.5263216773823127, 1.521877766243235, 1.5176745072050215, 1.5159723241564347, 1.5118595340890693, 1.505702328364038, 1.5015089909991184, 1.4963431778687801, 1.4931144576721218, 1.487536219041169, 1.482084487511379, 1.479376979935184, 1.4756704295136052, 1.4699265118341525, 1.464267380722019, 1.4608702741491437, 1.4576039218856538, 1.4541747520849344, 1.4485654626627722, 1.442305974540704, 1.4483095477557382, 1.4449334534024794, 1.4395359688144573, 1.4360401050273368, 1.431318390134512, 1.4267212951376773, 1.4223693732558793, 1.4180786570876263, 1.4143528051397996, 1.4103765774337609, 1.405137486611523, 1.4013341823343977, 1.3972965463371347, 1.3939702258137434, 1.3930954905793484, 1.3862182336675275, 1.3816997290230144, 1.3786204372635644, 1.3718504490530294, 1.3668108144066167, 1.3641820993725786, 1.3618378449094168, 1.3576118429666406, 1.3514619258484795, 1.3476841165148965, 1.344667534145667, 1.3420425677315664, 1.3379154409489669, 1.331147411045945, 1.3283516904566741, 1.3324149085603154, 1.3372631078128312, 1.3275722777315915, 1.3228287548956155, 1.3184560436329402, 1.3139239578940467, 1.3093075231948292, 1.305550901999312, 1.3014179686253438, 1.2970055930259634, 1.2927751002061323, 1.2885111714900441, 1.2839692698581224, 1.2808262054065005, 1.2768250879383842, 1.2720399623004237, 1.2679457473011821, 1.273038936061159, 1.2766378466591837]}, {\"line\": {\"color\": \"navy\"}, \"marker\": {\"color\": \"grey\", \"size\": 4, \"symbol\": \"cross\"}, \"mode\": \"markers\", \"name\": \"Observed capacity\", \"type\": \"scatter\", \"x\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168], \"y\": [1.8564874208181568, 1.8463272497199268, 1.835349194223408, 1.8352625275821128, 1.8346455082120416, 1.8356616600675493, 1.8351461429226603, 1.8257567905665533, 1.8247738529891333, 1.824613268496936, 1.8246195526864504, 1.814201935767392, 1.8137521577549047, 1.8134404914735824, 1.8025980036306504, 1.8021069002461496, 1.8025795008262089, 1.8030683142834096, 1.802777624719604, 1.8470259949329195, 1.847417311283644, 1.8361774213478947, 1.825780747577624, 1.8251136435078368, 1.825581504220376, 1.814031127508391, 1.8147691941158937, 1.8139693887103518, 1.8027656651678232, 1.8040770401173518, 1.8518025516704488, 1.8307038456739428, 1.8199041089501269, 1.809307963702852, 1.8046099045805202, 1.7993770651972192, 1.7884432335370462, 1.7829230484252725, 1.7730337158018288, 1.773037755078937, 1.7678721106662054, 1.762315070409309, 1.7676172924938447, 1.762668359743147, 1.7517304870664143, 1.7418496047960008, 1.7360913511847138, 1.7936240148573608, 1.7831890223273277, 1.7673642076278957, 1.7570177850353066, 1.7468706179837907, 1.7417172507457144, 1.7364225056478186, 1.7263217239235826, 1.7158065389330133, 1.710533351135192, 1.706014499648521, 1.7003110272642588, 1.6945798601797897, 1.6849029086609286, 1.6744741591159715, 1.6745692479879102, 1.663716375981405, 1.6590138687482459, 1.6538540573335014, 1.6426537821301308, 1.6378578430223698, 1.6327350407099108, 1.6277528915533617, 1.622125485521159, 1.6113256603765849, 1.6065631397488385, 1.6015142233917594, 1.590369231400328, 1.5857889968242211, 1.5849430707374117, 1.5955263892495937, 1.5747301747801037, 1.5649019950937946, 1.5597659473370362, 1.5594815668184234, 1.5546893535906101, 1.5488741079890418, 1.5382365989425582, 1.5279142582510281, 1.5285252629756445, 1.5226473252843782, 1.5174859938489869, 1.605818899130659, 1.5638491446744425, 1.5480915247767786, 1.5323755631868592, 1.5269528268489705, 1.5169573017136326, 1.511897596014269, 1.5065638960681105, 1.5015453526671363, 1.4908444050400238, 1.485868384561201, 1.480413677976106, 1.4752095869031632, 1.4859035988304024, 1.4960918298136696, 1.4808005946928984, 1.4697543268466824, 1.4539012274845928, 1.454146206723569, 1.455023751906683, 1.4490421637612358, 1.4386709371480566, 1.4334454321569792, 1.4333958900838095, 1.4280648734477601, 1.4229203181741186, 1.417429032731308, 1.412409228794446, 1.4125787929401932, 1.4075983731469897, 1.4333920485221476, 1.4382550176792908, 1.4173547174485526, 1.4069816636776429, 1.4012037783587623, 1.3967008232726328, 1.391284788852726, 1.3862287677978349, 1.3804366761974138, 1.3752364150256224, 1.3705128024895008, 1.37050855662704, 1.3647355108681518, 1.375392016895762, 1.3861115151535393, 1.369850003583894, 1.3647827949260758, 1.3543220466259964, 1.3546417018378962, 1.354703921319241, 1.349314997503458, 1.3441891937970554, 1.3389913790695755, 1.3389145230206971, 1.3340066759761655, 1.3286444309174914, 1.323170899227622, 1.3181691588445197, 1.3184664436640334, 1.318293040102702, 1.3238724222442682, 1.3601216766554785, 1.3395306867947354, 1.3290286565120697, 1.3236741274998955, 1.318633896753293, 1.3134751321324272, 1.3132020634442203, 1.3077959946944353, 1.3030329186405918, 1.3033573559038203, 1.3034100438655642, 1.2978870806495706, 1.2980735056918902, 1.293463613844243, 1.288003392619118, 1.2874525221379407, 1.3090153642307354, 1.3250793286429356]}],\n",
              "                        {\"legend\": {\"x\": 0.77, \"xanchor\": \"left\", \"y\": 0.95, \"yanchor\": \"top\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"#f2f8fd\", \"template\": {\"data\": {\"bar\": [{\"error_x\": {\"color\": \"#2a3f5f\"}, \"error_y\": {\"color\": \"#2a3f5f\"}, \"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"bar\"}], \"barpolar\": [{\"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"baxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"choropleth\"}], \"contour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"contour\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"contourcarpet\"}], \"heatmap\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmap\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmapgl\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"histogram\"}], \"histogram2d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2d\"}], \"histogram2dcontour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2dcontour\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"parcoords\"}], \"pie\": [{\"automargin\": true, \"type\": \"pie\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter\"}], \"scatter3d\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattermapbox\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolar\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolargl\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"#EBF0F8\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"#C8D4E3\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowcolor\": \"#2a3f5f\", \"arrowhead\": 0, \"arrowwidth\": 1}, \"coloraxis\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"colorscale\": {\"diverging\": [[0, \"#8e0152\"], [0.1, \"#c51b7d\"], [0.2, \"#de77ae\"], [0.3, \"#f1b6da\"], [0.4, \"#fde0ef\"], [0.5, \"#f7f7f7\"], [0.6, \"#e6f5d0\"], [0.7, \"#b8e186\"], [0.8, \"#7fbc41\"], [0.9, \"#4d9221\"], [1, \"#276419\"]], \"sequential\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"sequentialminus\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]]}, \"colorway\": [\"#636efa\", \"#EF553B\", \"#00cc96\", \"#ab63fa\", \"#FFA15A\", \"#19d3f3\", \"#FF6692\", \"#B6E880\", \"#FF97FF\", \"#FECB52\"], \"font\": {\"color\": \"#2a3f5f\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"white\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"#C8D4E3\"}, \"hoverlabel\": {\"align\": \"left\"}, \"hovermode\": \"closest\", \"mapbox\": {\"style\": \"light\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"white\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"radialaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"yaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"zaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}}, \"shapedefaults\": {\"line\": {\"color\": \"#2a3f5f\"}}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"baxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"caxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}}, \"title\": {\"x\": 0.05}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}}}, \"title\": {\"text\": \"Comparison of hybrid twin with other models\"}, \"xaxis\": {\"title\": {\"text\": \"Cycles\"}}, \"yaxis\": {\"title\": {\"text\": \"Capacity in Ahr\"}}},\n",
              "                        {\"responsive\": true}\n",
              "                    ).then(function(){\n",
              "                            \n",
              "var gd = document.getElementById('24b18cb1-6e78-447b-bf60-418ccae79438');\n",
              "var x = new MutationObserver(function (mutations, observer) {{\n",
              "        var display = window.getComputedStyle(gd).display;\n",
              "        if (!display || display === 'none') {{\n",
              "            console.log([gd, 'removed!']);\n",
              "            Plotly.purge(gd);\n",
              "            observer.disconnect();\n",
              "        }}\n",
              "}});\n",
              "\n",
              "// Listen for the removal of the full notebook cells\n",
              "var notebookContainer = gd.closest('#notebook-container');\n",
              "if (notebookContainer) {{\n",
              "    x.observe(notebookContainer, {childList: true});\n",
              "}}\n",
              "\n",
              "// Listen for the clearing of the current output cell\n",
              "var outputEl = gd.closest('.output');\n",
              "if (outputEl) {{\n",
              "    x.observe(outputEl, {childList: true});\n",
              "}}\n",
              "\n",
              "                        })\n",
              "                };\n",
              "                \n",
              "            </script>\n",
              "        </div>\n",
              "</body>\n",
              "</html>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "lt2L-FqWS2S3"
      },
      "source": [
        "## 5. Prediction whit hybrid twin model\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "pf-mRrfdJ5ek"
      },
      "source": [
        "cycles = np.arange(168,500,1)\n",
        "temperature = dfb['Temperature_measured'].iloc[167]\n",
        "time = dfb['Time'].iloc[167]\n",
        "K = 0.13\n",
        "L_e = 1-e**(-K*cycles*temperature/time)\n",
        "X_in_e = -(L_e*dfb['Capacity'].iloc[0:1].values[0]) + dfb['Capacity'].iloc[0:1].values[0]\n",
        "C_twin_e = X_in_e + model.predict(X_in_e).reshape(-1)"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 542
        },
        "id": "4WJpp8TzMvPq",
        "outputId": "0840db8c-cb67-4a77-cb1e-dedfb990b2d8"
      },
      "source": [
        "X_twin = X_in + model.predict(X_in).reshape(-1)\n",
        "\n",
        "fig = go.Figure()\n",
        "\n",
        "fig.add_trace(go.Scatter(x=cycles, \n",
        "                         y=X_in_e,\n",
        "                         mode='lines',\n",
        "                         name=f'C modelled (predicted)',\n",
        "                         line=dict(color='navy', \n",
        "                                   width=3,\n",
        "                                   dash='dash')))\n",
        "fig.add_trace(go.Scatter(x=cycles, \n",
        "                         y=C_twin_e,\n",
        "                         mode='lines',\n",
        "                         name=f'C Digital twin (predicted)',\n",
        "                         line=dict(color='crimson', \n",
        "                                   width=3,\n",
        "                                   dash='dash'\n",
        "                                  )))\n",
        "\n",
        "fig.add_trace(go.Scatter(x=dfb.index, \n",
        "                         y=X_twin,\n",
        "                         mode='lines',\n",
        "                         name=f'C Digital twin',\n",
        "                         line=dict(color='crimson',\n",
        "                                   width=2)))\n",
        "fig.add_trace(go.Scatter(x=dfb.index, \n",
        "                         y=dfb['C. Capacity'],\n",
        "                         mode='lines',\n",
        "                         name=f'C modelled',\n",
        "                         line=dict(color='navy', \n",
        "                                   width=2)))\n",
        "\n",
        "fig.update_layout(\n",
        "    title=\"Battery capacity prediction\",\n",
        "    xaxis_title=\"Cycles\",\n",
        "    yaxis_title=\"Battery capacity [Ahr]\")\n",
        "fig.update_layout(legend=dict(\n",
        "    yanchor=\"top\",\n",
        "    y=0.95,\n",
        "    xanchor=\"left\",\n",
        "    x=0.72\n",
        "))\n",
        "fig.update_layout({'plot_bgcolor': '#f2f8fd',\n",
        "                  'paper_bgcolor': 'white',}, \n",
        "                   template='plotly_white')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<html>\n",
              "<head><meta charset=\"utf-8\" /></head>\n",
              "<body>\n",
              "    <div>\n",
              "            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>\n",
              "                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
              "        <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>    \n",
              "            <div id=\"7c2d7a60-71f1-408d-b211-7aff4e855bc4\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>\n",
              "            <script type=\"text/javascript\">\n",
              "                \n",
              "                    window.PLOTLYENV=window.PLOTLYENV || {};\n",
              "                    \n",
              "                if (document.getElementById(\"7c2d7a60-71f1-408d-b211-7aff4e855bc4\")) {\n",
              "                    Plotly.newPlot(\n",
              "                        '7c2d7a60-71f1-408d-b211-7aff4e855bc4',\n",
              "                        [{\"line\": {\"color\": \"navy\", \"dash\": \"dash\", \"width\": 3}, \"mode\": \"lines\", \"name\": \"C modelled (predicted)\", \"type\": \"scatter\", \"x\": [168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499], \"y\": [1.2766378466591837, 1.2737955091921835, 1.2709594999742615, 1.2681298049160508, 1.2653064099595523, 1.2624893010780673, 1.2596784642761258, 1.256873885589418, 1.2540755510847235, 1.251283446859845, 1.248497559043536, 1.2457178737954337, 1.2429443773059896, 1.2401770557964018, 1.237415895518545, 1.2346608827549037, 1.2319120038185025, 1.2291692450528404, 1.2264325928318205, 1.2237020335596835, 1.2209775536709406, 1.2182591396303053, 1.2155467779326257, 1.212840455102819, 1.2101401576958026, 1.20744587229643, 1.2047575855194217, 1.2020752840092983, 1.1993989544403172, 1.1967285835164034, 1.1940641579710851, 1.1914056645674276, 1.1887530900979661, 1.1861064213846426, 1.183465645278738, 1.1808307486608085, 1.178201718440619, 1.1755785415570799, 1.1729612049781801, 1.1703496957009236, 1.1677440007512652, 1.165144107184044, 1.1625500020829223, 1.1599616725603186, 1.1573791057573444, 1.1548022888437415, 1.1522312090178162, 1.1496658535063777, 1.1471062095646731, 1.1445522644763253, 1.142004005553269, 1.139461420135687, 1.1369244955919506, 1.134393219318552, 1.131867578740045, 1.129347561308982, 1.1268331545058516, 1.1243243458390153, 1.1218211228446466, 1.1193234730866686, 1.1168313841566935, 1.1143448436739583, 1.111863839285265, 1.1093883586649207, 1.1069183895146728, 1.104453919563651, 1.1019949365683042, 1.0995414283123415, 1.0970933826066709, 1.094650787289337, 1.0922136302254633, 1.0897818993071908, 1.087355582453617, 1.0849346676107368, 1.082519142751383, 1.080108995875165, 1.0777042150084113, 1.0753047882041078, 1.0729107035418401, 1.0705219491277338, 1.0681385130943948, 1.0657603836008511, 1.0633875488324944, 1.0610199970010195, 1.058657716344368, 1.056300695126668, 1.0539489216381774, 1.0516023841952244, 1.0492610711401507, 1.0469249708412514, 1.0445940716927207, 1.0422683621145907, 1.0399478305526761, 1.0376324654785163, 1.0353222553893173, 1.0330171888078958, 1.0307172542826208, 1.028422440387359, 1.0261327357214145, 1.0238481289094756, 1.021568608601557, 1.0192941634729422, 1.0170247822241287, 1.0147604535807724, 1.0125011662936294, 1.010246909138502, 1.0079976709161826, 1.0057534404523973, 1.003514206597751, 1.0012799582276717, 0.9990506842423559, 0.9968263735667126, 0.9946070151503091, 0.9923925979673148, 0.9901831110164481, 0.9879785433209203, 0.9857788839283824, 0.9835841219108695, 0.9813942463647467, 0.979209246410656, 0.9770291111934608, 0.9748538298821928, 0.9726833916699983, 0.9705177857740842, 0.9683570014356638, 0.966201027919905, 0.9640498545158755, 0.9619034705364898, 0.9597618653184573, 0.9576250282222273, 0.9554929486319379, 0.9533656159553625, 0.9512430196238574, 0.9491251490923085, 0.9470119938390809, 0.9449035433659639, 0.9427997871981216, 0.9407007148840386, 0.9386063159954691, 0.9365165801273853, 0.9344314968979254, 0.9323510559483418, 0.93027524694295, 0.9282040595690773, 0.9261374835370108, 0.9240755085799474, 0.9220181244539424, 0.9199653209378577, 0.9179170878333127, 0.9158734149646321, 0.9138342921787959, 0.9117997093453898, 0.9097696563565533, 0.9077441231269305, 0.9057230995936204, 0.9037065757161251, 0.9016945414763019, 0.8996869868783129, 0.8976839019485743, 0.895685276735709, 0.8936911013104948, 0.8917013657658163, 0.8897160602166162, 0.8877351747998449, 0.8857586996744125, 0.8837866250211392, 0.8818189410427072, 0.8798556379636115, 0.8778967060301116, 0.8759421355101829, 0.8739919166934684, 0.8720460398912303, 0.8701044954363026, 0.8681672736830421, 0.866234365007281, 0.8643057598062787, 0.8623814484986748, 0.8604614215244406, 0.8585456693448329, 0.8566341824423448, 0.8547269513206601, 0.8528239665046053, 0.8509252185401024, 0.849030697994122, 0.8471403954546375, 0.8452543015305765, 0.8433724068517758, 0.8414947020689343, 0.8396211778535649, 0.8377518248979516, 0.8358866339151008, 0.8340255956386944, 0.8321687008230467, 0.8303159402430564, 0.8284673046941604, 0.8266227849922894, 0.8247823719738223, 0.8229460564955389, 0.821113829434577, 0.8192856816883844, 0.8174616041746765, 0.8156415878313885, 0.8138256236166324, 0.8120137025086505, 0.8102058155057721, 0.8084019536263674, 0.8066021079088046, 0.8048062694114029, 0.8030144292123904, 0.8012265784098587, 0.7994427081217186, 0.7976628094856559, 0.7958868736590887, 0.7941148918191216, 0.7923468551625028, 0.7905827549055806, 0.7888225822842594, 0.787066328553955, 0.785313984989555, 0.7835655428853701, 0.7818209935550946, 0.7800803283317628, 0.7783435385677044, 0.776610615634503, 0.7748815509229527, 0.7731563358430151, 0.7714349618237772, 0.7697174203134081, 0.7680037027791169, 0.7662938007071107, 0.7645877056025518, 0.7628854089895156, 0.7611869024109483, 0.7594921774286254, 0.7578012256231088, 0.7561140385937068, 0.75443060795843, 0.7527509253539519, 0.7510749824355656, 0.7494027708771429, 0.7477342823710944, 0.7460695086283249, 0.744408441378196, 0.7427510723684825, 0.7410973933653318, 0.7394473961532244, 0.7378010725349313, 0.7361584143314739, 0.7345194133820838, 0.7328840615441619, 0.7312523506932378, 0.7296242727229296, 0.727999819544904, 0.7263789830888359, 0.7247617553023669, 0.7231481281510685, 0.7215380936183982, 0.7199316437056638, 0.7183287704319796, 0.7167294658342303, 0.7151337219670288, 0.7135415309026785, 0.7119528847311329, 0.7103677755599569, 0.7087861955142865, 0.7072081367367915, 0.705633591387635, 0.704062551644435, 0.7024950097022256, 0.7009309577734169, 0.6993703880877589, 0.6978132928923013, 0.6962596644513548, 0.694709495046453, 0.6931627769763138, 0.6916195025568019, 0.6900796641208904, 0.6885432540186218, 0.6870102646170708, 0.6854806883003066, 0.6839545174693542, 0.6824317445421575, 0.6809123619535415, 0.6793963621551737, 0.677883737615528, 0.6763744808198464, 0.6748685842701021, 0.6733660404849622, 0.6718668419997498, 0.6703709813664087, 0.6688784511534642, 0.6673892439459874, 0.6659033523455584, 0.6644207689702293, 0.6629414864544878, 0.6614654974492193, 0.6599927946216728, 0.6585233706554225, 0.6570572182503318, 0.6555943301225178, 0.6541346990043142, 0.6526783176442361, 0.6512251788069428, 0.6497752752732031, 0.6483285998398591, 0.6468851453197892, 0.645444904541874, 0.6440078703509604, 0.6425740356078249, 0.6411433931891397, 0.639715935987436, 0.6382916569110695, 0.636870548884185, 0.6354526048466811, 0.6340378177541746, 0.6326261805779669, 0.6312176863050081, 0.629812327937862, 0.6284100984946719, 0.6270109910091257, 0.6256149985304207, 0.6242221141232307, 0.6228323308676698, 0.6214456418592582, 0.6200620402088901, 0.6186815190427954, 0.6173040715025102, 0.6159296907448388, 0.6145583699418222, 0.6131901022807034, 0.6118248809638926, 0.6104626992089361]}, {\"line\": {\"color\": \"crimson\", \"dash\": \"dash\", \"width\": 3}, \"mode\": \"lines\", \"name\": \"C Digital twin (predicted)\", \"type\": \"scatter\", \"x\": [168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499], \"y\": [1.2606396768794061, 1.2575999102024584, 1.2545669523370373, 1.2515407184132603, 1.2485212204501606, 1.245508466772781, 1.2425024061327485, 1.2395030245657535, 1.2365103342156076, 1.2335242690260495, 1.2305449268845414, 1.2275721784667213, 1.2246059913365892, 1.2216465081775358, 1.2186935587792433, 1.2157471964794215, 1.2128074113163854, 1.2098741374795696, 1.2069474582004251, 1.2040272108715808, 1.20111353466445, 1.1982062819332953, 1.1953055248546418, 1.1924112462281165, 1.1895233879051532, 1.1866419960752501, 1.1837669642208701, 1.18089835349234, 1.178036172915659, 1.1751803309636557, 1.172330821820439, 1.169487684403138, 1.1666508906031274, 1.1638204160664778, 1.1609962178421478, 1.1581782455577907, 1.1553666500359445, 1.1525612841050688, 1.1497621719860556, 1.1469692373459737, 1.1441825975959383, 1.141402116856209, 1.1386278678921244, 1.1358597521344267, 1.1330977902518398, 1.1303420290187502, 1.127592351325336, 1.124848826354793, 1.122111437637078, 1.1193800308947823, 1.1166548355837103, 1.1139356378783685, 1.1112225294552567, 1.1085154194797706, 1.1058143587063993, 1.1031193010600826, 1.1004302973512439, 1.0977471972525037, 1.0950701484875185, 1.0923990194109217, 1.0897338236913576, 1.087074545222773, 1.0844212424324857, 1.0817738582913188, 1.0791323022699237, 1.0764966813067196, 1.073866938454672, 1.0712429795411031, 1.068624915311501, 1.0660126702739752, 1.0634062546453908, 1.060805630240857, 1.058210758902439, 1.0556217254336795, 1.0530384209498636, 1.0504608893299552, 1.0478890850726699, 1.0453229813298326, 1.0427626406868349, 1.0402079469416738, 1.0376589627327615, 1.0351156948455773, 1.0325780383332555, 1.0300460335615549, 1.0275197171971913, 1.024998947119132, 1.0224838271016345, 1.0199743380104462, 1.0174704234844252, 1.0149720793424473, 1.012479249275223, 1.009992026010913, 1.0075103085883645, 1.0050341376331813, 1.0025634681149567, 1.000098284831217, 0.9976386247591051, 0.9951844280437139, 0.9927356758337669, 0.9902923865562747, 0.9878545674877035, 0.9854221216216601, 0.982995127065609, 0.980573572545206, 0.9781573238766277, 0.9757465262978686, 0.9733410494004318, 0.9709409527905588, 0.9685461768900807, 0.9661567590031996, 0.9637726582277895, 0.9613938634887592, 0.9590203376586443, 0.9566521442174197, 0.9542891827568369, 0.9519314795530103, 0.9495790497306228, 0.9472318376582259, 0.9448898771356684, 0.9425530939536572, 0.9402215517628616, 0.9378951838529589, 0.9355740017688371, 0.9332579910024129, 0.9309471296190287, 0.9286414143344329, 0.9263408381629836, 0.9240453606152729, 0.921754982203881, 0.9194697444433214, 0.9171895920142488, 0.9149145329508879, 0.9126444970799502, 0.910379526010386, 0.9081195980446892, 0.9058647324869719, 0.903614859257753, 0.9013699604549367, 0.8991301001560831, 0.8968952344285518, 0.8946653305387392, 0.8924403706773171, 0.8902203929373749, 0.8880053683797882, 0.8857952382860704, 0.883590048268773, 0.8813897657322093, 0.8791943879058218, 0.8770038971406495, 0.8748182609092752, 0.8726375212127429, 0.8704616306677355, 0.8682905828916828, 0.8661243566233581, 0.8639629790527631, 0.8618064066117874, 0.8596546032052562, 0.8575076109913958, 0.8553654013701708, 0.8532279681154945, 0.8510952938475641, 0.8489673351316515, 0.8468441565885053, 0.8447256850251409, 0.8426119515786616, 0.8405028644735013, 0.8383985442975023, 0.8362988732417411, 0.8342038750800899, 0.8321135512563949, 0.8300278846097187, 0.8279468468248717, 0.8258704654875912, 0.8237987048752018, 0.8217315292865035, 0.8196689589210782, 0.8176110363516297, 0.8155576216329687, 0.8135088169850612, 0.8114645756374971, 0.8094248694675088, 0.8073897076263743, 0.8053590732094349, 0.8033329791354031, 0.8013114010910911, 0.7992942887072332, 0.7972816959436013, 0.7952735575715397, 0.7932699350430772, 0.7912707147423692, 0.7892759954158408, 0.7872857081925293, 0.7852998401014586, 0.7833183930933982, 0.7813413393373336, 0.7793687218032597, 0.7774004754482009, 0.7754366134806787, 0.7734771267778311, 0.7715220062371058, 0.7695712576773792, 0.7676248049813614, 0.7656827024370993, 0.7637449596492869, 0.761811500561028, 0.7598823534435957, 0.757957505610068, 0.7560369294923126, 0.7541206385202994, 0.7522086349679908, 0.7503008391727821, 0.7483973130528747, 0.7464980328645254, 0.7446029637078069, 0.7427121489335313, 0.7408255387798539, 0.738943087229776, 0.7370648600445193, 0.7351907888943268, 0.7333209246781538, 0.7314552065556306, 0.7295936556621136, 0.7277362298223202, 0.725882950210156, 0.724033789589964, 0.722188720745254, 0.720347809610919, 0.7185109619534513, 0.7166782362952855, 0.7148495570674032, 0.7130249530278696, 0.7112044455030826, 0.7093879515301824, 0.7075755297261699, 0.7057671493198652, 0.703962757207093, 0.7021624157863795, 0.7003660682656245, 0.6985737249265724, 0.6967853513660631, 0.6950009914305713, 0.6932205884022278, 0.6914441563621361, 0.6896716684316195, 0.6879031648055993, 0.6861385404110083, 0.6843778466552621, 0.6826211126122852, 0.6808682667913741, 0.6791193494787036, 0.6773743003957391, 0.6756331673154532, 0.6738958564678357, 0.6721624603653995, 0.6704329001752707, 0.6687071976653431, 0.6669897294857554, 0.6652834715953446, 0.6635810175866923, 0.6618823557713926, 0.6601875117316716, 0.658496376956994, 0.6568090552960228, 0.6551254568999361, 0.6534456558502564, 0.6517695548826865, 0.6500971983114536, 0.6484285745888854, 0.646763664734145, 0.6451024274320301, 0.6434449107916449, 0.6417910772577169, 0.6401409414462984, 0.6384944770124716, 0.6368516874308254, 0.6352125389401924, 0.633577031324126, 0.6319451830097012, 0.6303169453857991, 0.6286923592652629, 0.6270713872467952, 0.6254540068471788, 0.6238402552047222, 0.6222300800676093, 0.6206234813548945, 0.6190204590024007, 0.617421020413262, 0.6158251469302747, 0.6142328236381813, 0.6126440132866033, 0.6110587531475495, 0.6094770395313813, 0.6078988575890982, 0.6063241999387523, 0.6047529772584448, 0.6031853163095118, 0.6016211240775253, 0.60006039697135, 0.598503187295494, 0.596949420710849, 0.5953991160267809, 0.5938522622665143, 0.592308844744128, 0.5907688785921328, 0.5892323305303384, 0.5876992082727845, 0.5861694971977711, 0.5846431826995646, 0.5831202799906832, 0.5816007595960573, 0.5800846218587987, 0.5785718820390049, 0.5770624771814663, 0.5755564672813067, 0.574053781964208, 0.5725544514543746, 0.5710584612881757, 0.5695657895670143, 0.5680764553860655, 0.5665904443284369, 0.5651077233662933, 0.5636282967401798, 0.5621521836072423, 0.5606793584365497, 0.5592098031631252, 0.5577531258874591, 0.5563007590339815, 0.5548515893482782, 0.553405684508196, 0.5519629780963333, 0.5505234856668422, 0.5490872004372687]}, {\"line\": {\"color\": \"crimson\", \"width\": 2}, \"mode\": \"lines\", \"name\": \"C Digital twin\", \"type\": \"scatter\", \"x\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168], \"y\": [1.8777822929687313, 1.874751533733963, 1.871735603617768, 1.868753008581784, 1.8657923991197967, 1.8627753284752977, 1.8597534744177486, 1.8567843161842945, 1.8538076333160685, 1.8508518490230979, 1.8478987869619201, 1.8446868043723958, 1.8416660727712433, 1.8387597995257368, 1.8358409647632434, 1.8329063463696444, 1.8298295245622949, 1.826693679749648, 1.8236583796855315, 1.8221299437406455, 1.8184742686728432, 1.8159216381980108, 1.813184013676912, 1.8103226809020616, 1.8073290181822126, 1.8044351593658596, 1.8014470734212458, 1.7984059420394924, 1.7953346417184919, 1.7921477351883717, 1.790457880004199, 1.7866278651471135, 1.7836419788133777, 1.7811711734251117, 1.7780860811883001, 1.7739200226810394, 1.7710786288983145, 1.7677715441232371, 1.7649373264805701, 1.7609206813680864, 1.7560638678175855, 1.7525187597678267, 1.751282065450247, 1.7484172748068025, 1.7458634733412757, 1.7423862968270216, 1.7382457994098859, 1.7306393811950844, 1.7299253245324562, 1.728187193657829, 1.7256510052237672, 1.7226305918657172, 1.7184622938807392, 1.713662238355796, 1.7110173377531188, 1.7069583285923233, 1.7041063153345144, 1.6993664446403893, 1.6950278562364027, 1.6917908446167171, 1.6880790909647583, 1.6847035641974246, 1.679532125055814, 1.676804837295117, 1.6713849236395948, 1.6675141753296487, 1.6639886804866444, 1.6598453510650562, 1.655572619887917, 1.6514412268783105, 1.6471634343185477, 1.6434750607817403, 1.6389787863342105, 1.6348173687422074, 1.6310443233469445, 1.6268419145003727, 1.6246130365805302, 1.620800678525971, 1.6172622869642284, 1.6135020925664851, 1.6082123826016512, 1.6014201174660982, 1.596622153495726, 1.5926161129666205, 1.5895893098425522, 1.5859696222746402, 1.5799679033778415, 1.5744426941137695, 1.56981023185744, 1.5837425574035346, 1.5705395266334952, 1.5642009780505621, 1.5601179362445041, 1.5559476460326223, 1.5516168252508444, 1.5463765879636495, 1.541768821270049, 1.537182187001216, 1.5324331652628183, 1.5276687386289463, 1.5229160344517387, 1.5184206232471587, 1.5166001585063054, 1.5122014971120166, 1.5056164268950458, 1.501131593014852, 1.4956067960101929, 1.4921537164800194, 1.486187779437125, 1.4803571337299173, 1.4774614542901663, 1.4734973335720616, 1.4673542324106772, 1.4613018112258642, 1.4576685920285821, 1.4541752429260457, 1.450507770030224, 1.4445086625059405, 1.437814347324365, 1.4442349407112798, 1.4406242871796686, 1.4348519750576862, 1.4311133452776859, 1.4260636334752426, 1.4211472140446044, 1.4164930407344407, 1.4119043125181816, 1.407919679554482, 1.4036672513751347, 1.398064311449446, 1.3939968356613859, 1.3896788082392286, 1.3861214154092043, 1.3851859430417832, 1.3778310331331838, 1.3729986802316059, 1.3697055270067018, 1.3624653065776628, 1.357075673457129, 1.3542643595938215, 1.3517572801422946, 1.3472377625769025, 1.3406606999478294, 1.3366204886162034, 1.3333944182723303, 1.3305871175245714, 1.3261733333787955, 1.3189352537964942, 1.3159453300986743, 1.3202907575688756, 1.3254756671850179, 1.315111762828523, 1.3100387902197121, 1.3053623858413257, 1.3005155130722121, 1.2955784873404896, 1.2915609058342747, 1.2871409537439713, 1.282422079885285, 1.2778977734196142, 1.2733376841247983, 1.2684803211851126, 1.2651189658978717, 1.2608399380481998, 1.2557224680868426, 1.2513439054044098, 1.2567908440058382, 1.260639688055277]}, {\"line\": {\"color\": \"navy\", \"width\": 2}, \"mode\": \"lines\", \"name\": \"C modelled\", \"type\": \"scatter\", \"x\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168], \"y\": [1.8536842133171372, 1.850850402729868, 1.8480304675868555, 1.8452416845039394, 1.842473478835287, 1.8396524255157125, 1.8368269464109566, 1.8340507209620598, 1.831267470067291, 1.828503784093851, 1.825742611735947, 1.8227393050077814, 1.8199149036559383, 1.817197480276822, 1.8144683298457458, 1.8117243494578803, 1.8088474788820104, 1.8059154298004312, 1.803077368956457, 1.8016482343497668, 1.7982301806489422, 1.795843333042972, 1.793283620935947, 1.7906082695539571, 1.787809156394655, 1.7851032906279236, 1.7823094115171492, 1.7794658471810845, 1.776594140463695, 1.7736143377224274, 1.7720343040962534, 1.7684531684334275, 1.7656613026690162, 1.763351072193775, 1.7604664378279238, 1.7565710589137493, 1.7539143054193773, 1.75082215499336, 1.7481720933513072, 1.7444164793300367, 1.7398752500218797, 1.7365605809794031, 1.7354041890194971, 1.7327255958357504, 1.7303377784047618, 1.727086473691884, 1.7232150912459092, 1.7161029296467465, 1.715435290101237, 1.7138100876767175, 1.7114386688325567, 1.7086145559214938, 1.7047170939917946, 1.7002289346717998, 1.6977559338646548, 1.6939607497627964, 1.691294032444433, 1.686862146400443, 1.6828054656145022, 1.6797788509402931, 1.6763082874834179, 1.673152061105374, 1.66831671020391, 1.6657666270521303, 1.660698932143747, 1.6570796930830114, 1.6537832663404595, 1.6499092083522247, 1.645914111885159, 1.6420511744703306, 1.6380513854243808, 1.6346026896147958, 1.630398623212987, 1.6265075909161366, 1.6229797068754155, 1.6190503953353337, 1.6169663604275857, 1.6134017267272935, 1.6100932526321914, 1.6065773925745437, 1.6016314523984518, 1.59528055220688, 1.590794383858618, 1.5870486815167304, 1.5842185401928082, 1.580834067454341, 1.575222345473598, 1.5700561908643627, 1.565724769317052, 1.5787517003090084, 1.566406644872898, 1.5604799643853628, 1.5566622675566837, 1.5527629400599507, 1.548713568685512, 1.5438138452833383, 1.5395054950721865, 1.5352168877525205, 1.530776487688899, 1.5263216773823127, 1.521877766243235, 1.5176745072050215, 1.5159723241564347, 1.5118595340890693, 1.505702328364038, 1.5015089909991184, 1.4963431778687801, 1.4931144576721218, 1.487536219041169, 1.482084487511379, 1.479376979935184, 1.4756704295136052, 1.4699265118341525, 1.464267380722019, 1.4608702741491437, 1.4576039218856538, 1.4541747520849344, 1.4485654626627722, 1.442305974540704, 1.4483095477557382, 1.4449334534024794, 1.4395359688144573, 1.4360401050273368, 1.431318390134512, 1.4267212951376773, 1.4223693732558793, 1.4180786570876263, 1.4143528051397996, 1.4103765774337609, 1.405137486611523, 1.4013341823343977, 1.3972965463371347, 1.3939702258137434, 1.3930954905793484, 1.3862182336675275, 1.3816997290230144, 1.3786204372635644, 1.3718504490530294, 1.3668108144066167, 1.3641820993725786, 1.3618378449094168, 1.3576118429666406, 1.3514619258484795, 1.3476841165148965, 1.344667534145667, 1.3420425677315664, 1.3379154409489669, 1.331147411045945, 1.3283516904566741, 1.3324149085603154, 1.3372631078128312, 1.3275722777315915, 1.3228287548956155, 1.3184560436329402, 1.3139239578940467, 1.3093075231948292, 1.305550901999312, 1.3014179686253438, 1.2970055930259634, 1.2927751002061323, 1.2885111714900441, 1.2839692698581224, 1.2808262054065005, 1.2768250879383842, 1.2720399623004237, 1.2679457473011821, 1.273038936061159, 1.2766378466591837]}],\n",
              "                        {\"legend\": {\"x\": 0.72, \"xanchor\": \"left\", \"y\": 0.95, \"yanchor\": \"top\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"#f2f8fd\", \"template\": {\"data\": {\"bar\": [{\"error_x\": {\"color\": \"#2a3f5f\"}, \"error_y\": {\"color\": \"#2a3f5f\"}, \"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"bar\"}], \"barpolar\": [{\"marker\": {\"line\": {\"color\": \"white\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"baxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"#C8D4E3\", \"linecolor\": \"#C8D4E3\", \"minorgridcolor\": \"#C8D4E3\", \"startlinecolor\": \"#2a3f5f\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"choropleth\"}], \"contour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"contour\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"contourcarpet\"}], \"heatmap\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmap\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmapgl\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"histogram\"}], \"histogram2d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2d\"}], \"histogram2dcontour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2dcontour\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"parcoords\"}], \"pie\": [{\"automargin\": true, \"type\": \"pie\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter\"}], \"scatter3d\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattermapbox\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolar\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolargl\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"#EBF0F8\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"#C8D4E3\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowcolor\": \"#2a3f5f\", \"arrowhead\": 0, \"arrowwidth\": 1}, \"coloraxis\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"colorscale\": {\"diverging\": [[0, \"#8e0152\"], [0.1, \"#c51b7d\"], [0.2, \"#de77ae\"], [0.3, \"#f1b6da\"], [0.4, \"#fde0ef\"], [0.5, \"#f7f7f7\"], [0.6, \"#e6f5d0\"], [0.7, \"#b8e186\"], [0.8, \"#7fbc41\"], [0.9, \"#4d9221\"], [1, \"#276419\"]], \"sequential\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"sequentialminus\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]]}, \"colorway\": [\"#636efa\", \"#EF553B\", \"#00cc96\", \"#ab63fa\", \"#FFA15A\", \"#19d3f3\", \"#FF6692\", \"#B6E880\", \"#FF97FF\", \"#FECB52\"], \"font\": {\"color\": \"#2a3f5f\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"white\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"#C8D4E3\"}, \"hoverlabel\": {\"align\": \"left\"}, \"hovermode\": \"closest\", \"mapbox\": {\"style\": \"light\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"white\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"radialaxis\": {\"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"yaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}, \"zaxis\": {\"backgroundcolor\": \"white\", \"gridcolor\": \"#DFE8F3\", \"gridwidth\": 2, \"linecolor\": \"#EBF0F8\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"#EBF0F8\"}}, \"shapedefaults\": {\"line\": {\"color\": \"#2a3f5f\"}}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"baxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}, \"bgcolor\": \"white\", \"caxis\": {\"gridcolor\": \"#DFE8F3\", \"linecolor\": \"#A2B1C6\", \"ticks\": \"\"}}, \"title\": {\"x\": 0.05}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"#EBF0F8\", \"linecolor\": \"#EBF0F8\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"#EBF0F8\", \"zerolinewidth\": 2}}}, \"title\": {\"text\": \"Battery capacity prediction\"}, \"xaxis\": {\"title\": {\"text\": \"Cycles\"}}, \"yaxis\": {\"title\": {\"text\": \"Battery capacity [Ahr]\"}}},\n",
              "                        {\"responsive\": true}\n",
              "                    ).then(function(){\n",
              "                            \n",
              "var gd = document.getElementById('7c2d7a60-71f1-408d-b211-7aff4e855bc4');\n",
              "var x = new MutationObserver(function (mutations, observer) {{\n",
              "        var display = window.getComputedStyle(gd).display;\n",
              "        if (!display || display === 'none') {{\n",
              "            console.log([gd, 'removed!']);\n",
              "            Plotly.purge(gd);\n",
              "            observer.disconnect();\n",
              "        }}\n",
              "}});\n",
              "\n",
              "// Listen for the removal of the full notebook cells\n",
              "var notebookContainer = gd.closest('#notebook-container');\n",
              "if (notebookContainer) {{\n",
              "    x.observe(notebookContainer, {childList: true});\n",
              "}}\n",
              "\n",
              "// Listen for the clearing of the current output cell\n",
              "var outputEl = gd.closest('.output');\n",
              "if (outputEl) {{\n",
              "    x.observe(outputEl, {childList: true});\n",
              "}}\n",
              "\n",
              "                        })\n",
              "                };\n",
              "                \n",
              "            </script>\n",
              "        </div>\n",
              "</body>\n",
              "</html>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    }
  ]
}